From ceb0af34967ba9c21ac710fdc0e3f62ae2358fc1 Mon Sep 17 00:00:00 2001 From: Bruno Wagner Date: Tue, 2 Jun 2015 18:18:09 -0300 Subject: Logging initializer don't need the whole args, only the debug option --- service/pixelated/config/__init__.py | 2 +- service/pixelated/config/logging_setup.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/service/pixelated/config/__init__.py b/service/pixelated/config/__init__.py index 35ae5e80..2706cd6f 100644 --- a/service/pixelated/config/__init__.py +++ b/service/pixelated/config/__init__.py @@ -46,7 +46,7 @@ def initialize(): args = parse_args() app = App() - init_logging(args) + init_logging(debug=args.debug) init_leap_cert(args) if args.register: diff --git a/service/pixelated/config/logging_setup.py b/service/pixelated/config/logging_setup.py index 023d9a9b..932f746d 100644 --- a/service/pixelated/config/logging_setup.py +++ b/service/pixelated/config/logging_setup.py @@ -19,13 +19,12 @@ import os from twisted.python import log -def init_logging(args): - debug_enabled = args.debug or os.environ.get('DEBUG', False) +def init_logging(debug=False): + debug_enabled = debug or os.environ.get('DEBUG', False) logging_level = logging.DEBUG if debug_enabled else logging.INFO log_format = "%(asctime)s [%(name)s] %(levelname)s %(message)s" date_format = '%Y-%m-%d %H:%M:%S' - logging.basicConfig(level=logging_level, format=log_format, datefmt=date_format, -- cgit v1.2.3