From d39331be3f55876a8a6fc31c5a10f2d68eefe0b0 Mon Sep 17 00:00:00 2001 From: Satoshi Fujii Date: Tue, 15 Jun 2021 13:19:51 +0000 Subject: Reformat code Use 4 spaces for indentation and put spaces for better readability. Signed-off-by: Satoshi Fujii Issue-ID: DCAEGEN2-2833 Change-Id: I99aa4df83a32b077e2a3f336d17b6b64184c3c12 --- miss_htbt_service/get_logger.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'miss_htbt_service/get_logger.py') diff --git a/miss_htbt_service/get_logger.py b/miss_htbt_service/get_logger.py index c94e333..bc8fea0 100644 --- a/miss_htbt_service/get_logger.py +++ b/miss_htbt_service/get_logger.py @@ -20,23 +20,22 @@ import logging.handlers '''Configures the module root logger''' root = logging.getLogger() if root.handlers: - #root.handlers.clear() + # root.handlers.clear() del root.handlers[:] formatter = logging.Formatter('%(asctime)s | %(name)s | %(module)s | %(funcName)s | %(lineno)d | %(levelname)s | %(message)s') handler = logging.StreamHandler() handler.setFormatter(formatter) root.addHandler(handler) -fhandler = logging.handlers.RotatingFileHandler('./hb_logs.txt', maxBytes=(1048576*5), backupCount=10) +fhandler = logging.handlers.RotatingFileHandler('./hb_logs.txt', maxBytes=(1048576 * 5), backupCount=10) fhandler.setFormatter(formatter) root.addHandler(fhandler) root.setLevel("DEBUG") + class BadEnviornmentENVNotFound(Exception): pass + def get_logger(module=None): '''Returns a module-specific logger or global logger if the module is None''' return root if module is None else root.getChild(module) - - - -- cgit 1.2.3-korg