Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Fixed logger initialization
Browse files Browse the repository at this point in the history
Erroneously wrapped the `_logger` setting in the
new if block.

Signed-off-by: James.E.Bell <[email protected]>
  • Loading branch information
James.E.Bell committed Dec 31, 2017
1 parent a159074 commit 4f1b71e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tgt_grease/core/Logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,18 +286,18 @@ def DefaultLogger(self):
"""
global GREASE_LOG_HANDLER
self._logger = logging.getLogger('GREASE')
self._logger.setLevel(logging.DEBUG)
self._formatter = logging.Formatter(
"{"
"\"timestamp\": \"%(asctime)s.%(msecs)03d\", "
"\"thread\": \"%(threadName)s\", "
"\"level\" : \"%(levelname)s\", "
"\"message\" : \"%(message)s\"}",
"%Y-%m-%d %H:%M:%S"
)
self._formatter.converter = time.gmtime
if not GREASE_LOG_HANDLER:
self._logger = logging.getLogger('GREASE')
self._logger.setLevel(logging.DEBUG)
self._formatter = logging.Formatter(
"{"
"\"timestamp\": \"%(asctime)s.%(msecs)03d\", "
"\"thread\": \"%(threadName)s\", "
"\"level\" : \"%(levelname)s\", "
"\"message\" : \"%(message)s\"}",
"%Y-%m-%d %H:%M:%S"
)
self._formatter.converter = time.gmtime
if os.path.isdir(self._conf.greaseDir):
GREASE_LOG_HANDLER = logging.FileHandler(self._conf.get('Logging', 'file'))
GREASE_LOG_HANDLER.setLevel(logging.DEBUG)
Expand Down

0 comments on commit 4f1b71e

Please sign in to comment.