mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Ugly hack to have the name of the main logger, otherwise error/exception messages ain't displayed
This commit is contained in:
parent
9609fe1210
commit
2501ecda56
2 changed files with 4 additions and 4 deletions
|
@ -90,12 +90,12 @@ def api(host="localhost", port=80, routes={}):
|
|||
except MoulinetteError as e:
|
||||
import logging
|
||||
|
||||
logging.getLogger().error(e.strerror)
|
||||
logging.getLogger(logging.main_logger).error(e.strerror)
|
||||
return 1
|
||||
except KeyboardInterrupt:
|
||||
import logging
|
||||
|
||||
logging.getLogger().info(m18n.g("operation_interrupted"))
|
||||
logging.getLogger(logging.main_logger).info(m18n.g("operation_interrupted"))
|
||||
return 0
|
||||
|
||||
|
||||
|
@ -121,8 +121,7 @@ def cli(args, top_parser, output_as=None, timeout=None):
|
|||
)
|
||||
except MoulinetteError as e:
|
||||
import logging
|
||||
|
||||
logging.getLogger().error(e.strerror)
|
||||
logging.getLogger(logging.main_logger).error(e.strerror)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
|
|
@ -65,6 +65,7 @@ def configure_logging(logging_config=None):
|
|||
# load configuration from dict
|
||||
dictConfig(DEFAULT_LOGGING)
|
||||
if logging_config:
|
||||
logging.main_logger = logging_config.get("main_logger")
|
||||
dictConfig(logging_config)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue