diff --git a/moulinette/__init__.py b/moulinette/__init__.py index 29f9bb98..625217f8 100755 --- a/moulinette/__init__.py +++ b/moulinette/__init__.py @@ -90,12 +90,12 @@ def api(host="localhost", port=80, routes={}): except MoulinetteError as e: import logging - logging.getLogger(logging.main_logger).error(e.strerror) + logging.getLogger("moulinette").error(e.strerror) return 1 except KeyboardInterrupt: import logging - logging.getLogger(logging.main_logger).info(m18n.g("operation_interrupted")) + logging.getLogger("moulinette").info(m18n.g("operation_interrupted")) return 0 @@ -122,7 +122,7 @@ def cli(args, top_parser, output_as=None, timeout=None): except MoulinetteError as e: import logging - logging.getLogger(logging.main_logger).error(e.strerror) + logging.getLogger("moulinette").error(e.strerror) return 1 return 0 diff --git a/moulinette/actionsmap.py b/moulinette/actionsmap.py index d36c59f7..d4a5f079 100644 --- a/moulinette/actionsmap.py +++ b/moulinette/actionsmap.py @@ -577,14 +577,14 @@ class ActionsMap(object): log_id = start_action_logging() if logger.isEnabledFor(logging.DEBUG): # Log arguments in debug mode only for safety reasons - logger.info( + logger.debug( "processing action [%s]: %s with args=%s", log_id, full_action_name, arguments, ) else: - logger.info("processing action [%s]: %s", log_id, full_action_name) + logger.debug("processing action [%s]: %s", log_id, full_action_name) # Load translation and process the action m18n.load_namespace(namespace) diff --git a/moulinette/interfaces/api.py b/moulinette/interfaces/api.py index 5d3d170c..a3427a2b 100644 --- a/moulinette/interfaces/api.py +++ b/moulinette/interfaces/api.py @@ -208,7 +208,7 @@ class _HTTPArgumentParser(object): def _error(self, message): # TODO: Raise a proper exception - raise MoulinetteError(message) + raise MoulinetteError(message, raw_msg=True) class _ActionsMapPlugin(object): diff --git a/moulinette/utils/log.py b/moulinette/utils/log.py index 65006d2e..375affc2 100644 --- a/moulinette/utils/log.py +++ b/moulinette/utils/log.py @@ -65,7 +65,6 @@ 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)