Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change loglevel to use upper() #84

Merged
merged 2 commits into from
Jan 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pyouroboros/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ def filter(self, record):


class OuroborosLogger(object):
def __init__(self, level='info'):
def __init__(self, level='INFO'):
# Create the Logger
self.logger = getLogger()
try:
self.logger.setLevel(level)
self.logger.setLevel(level.upper())
except ValueError:
level = "info"
self.logger.setLevel(level)
level = "INFO"
self.logger.setLevel(level.upper())

# Create a Formatter for formatting the log messages
logger_formatter = Formatter('%(asctime)s : %(levelname)s : %(module)s : %(message)s', '%Y-%m-%d %H:%M:%S')
Expand All @@ -43,7 +43,7 @@ def __init__(self, level='info'):
console_logger = StreamHandler()
console_logger.setFormatter(logger_formatter)

console_logger.setLevel(level)
console_logger.setLevel(level.upper())

# Add the Handler to the Logger
self.logger.addHandler(console_logger)