Skip to content

Commit

Permalink
Merge pull request #30 from nathan-v/Improve_Logger
Browse files Browse the repository at this point in the history
Switch to colorlog from rainbow-logging-handler which is not maintained
  • Loading branch information
nathan-v authored Nov 19, 2019
2 parents 90f052a + 1b227b2 commit 1159d96
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions aws_okta_keyman/keyman.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import xml
from builtins import input

import colorlog
import keyring
import rainbow_logging_handler
import requests

from aws_okta_keyman import aws, okta, okta_saml
Expand Down Expand Up @@ -96,9 +96,11 @@ def setup_logging():
"""Return back a pretty color-coded logger."""
logger = logging.getLogger()
logger.setLevel(logging.INFO)
handler = rainbow_logging_handler.RainbowLoggingHandler(sys.stdout)
fmt = '%(asctime)-10s (%(levelname)s) %(message)s'
formatter = logging.Formatter(fmt)
handler = colorlog.StreamHandler()
fmt = (
'%(asctime)-8s (%(bold)s%(log_color)s%(levelname)s%(reset)s) '
'%(message)s')
formatter = colorlog.ColoredFormatter(fmt, datefmt='%H:%M:%S')
handler.setFormatter(formatter)
logger.addHandler(handler)
return logger
Expand Down
2 changes: 1 addition & 1 deletion aws_okta_keyman/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# Copyright 2018 Nathan V
"""Package metadata."""

__version__ = '0.7.1'
__version__ = '0.7.2'
__desc__ = 'AWS Okta Keyman'
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bs4>=0.0.1
rainbow-logging-handler>=2.2.2
colorlog>=4.0.0
requests>=2.10.0
boto3>=1.4.0
future>=0.16.0
Expand Down

0 comments on commit 1159d96

Please sign in to comment.