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