Skip to content

Commit

Permalink
Allow overwite of log defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
joente committed Nov 18, 2022
1 parent 25cc8fa commit 738746e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions pylibagent/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
import logging.handlers
import os

_LOG_LEVEL = os.getenv('LOG_LEVEL', 'warning')
_LOG_COLORIZED = int(os.getenv('LOG_COLORIZED', '0'))
_LOG_DATE_FMT = os.getenv('LOG_FMT', '%y%m%d %H:%M:%S')


_MAP_LOG_LEVELS = {
'DEBUG': logging.DEBUG,
'INFO': logging.INFO,
Expand All @@ -19,6 +14,10 @@
def setup_logger():
"""Setup logger."""

_LOG_LEVEL = os.getenv('LOG_LEVEL', 'warning')
_LOG_COLORIZED = int(os.getenv('LOG_COLORIZED', '0'))
_LOG_DATE_FMT = os.getenv('LOG_FMT', '%y%m%d %H:%M:%S')

if _LOG_COLORIZED:
# setup colorized formatter
formatter = colorlog.ColoredFormatter(
Expand Down
2 changes: 1 addition & 1 deletion pylibagent/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.2'
__version__ = '0.1.3'

0 comments on commit 738746e

Please sign in to comment.