Output message only in production mode
This commit is contained in:
@@ -41,7 +41,7 @@ except ImportError:
|
||||
VERSION = 'Tornado ' + _version
|
||||
_GEVENT = False
|
||||
|
||||
from . import logger
|
||||
from . import logger, constants
|
||||
|
||||
|
||||
log = logger.create()
|
||||
@@ -216,8 +216,9 @@ class WebServer(object):
|
||||
try:
|
||||
sock, output = self._make_gevent_listener()
|
||||
log.info('Starting Gevent server on %s', output)
|
||||
# Also print to stdout so interactive terminals show a clear success message
|
||||
try:
|
||||
# Also print to stdout so interactive terminals show a clear success message
|
||||
if constants.APP_MODE not in ['development', 'test']:
|
||||
print(f"Calibre-Web: server started on {output}")
|
||||
except Exception:
|
||||
print(f"Calibre-Web: error {output}")
|
||||
@@ -274,6 +275,7 @@ class WebServer(object):
|
||||
log.info('Starting Tornado server on %s', output)
|
||||
# Also print to stdout so interactive terminals show a clear success message
|
||||
try:
|
||||
if constants.APP_MODE not in ['development', 'test']:
|
||||
print(f"Calibre-Web: server started on {output}")
|
||||
except Exception:
|
||||
print(f"Calibre-Web: error {output}")
|
||||
|
||||
Reference in New Issue
Block a user