From dd54b0124d1e010adf955522a9972a3e4f8f5f4b Mon Sep 17 00:00:00 2001 From: Caleb Lemoine Date: Sat, 12 Jan 2019 13:38:57 -0600 Subject: [PATCH 1/2] change loglevel to use upper() --- pyouroboros/logger.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyouroboros/logger.py b/pyouroboros/logger.py index f9645279..ebb776af 100644 --- a/pyouroboros/logger.py +++ b/pyouroboros/logger.py @@ -31,10 +31,10 @@ 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) + 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') @@ -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) From 1176ecfb3a7398ed2dc2610c74fb6105da97a7c9 Mon Sep 17 00:00:00 2001 From: Caleb Lemoine Date: Sat, 12 Jan 2019 13:45:48 -0600 Subject: [PATCH 2/2] uppercase default log level --- pyouroboros/logger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyouroboros/logger.py b/pyouroboros/logger.py index ebb776af..2ba19c5c 100644 --- a/pyouroboros/logger.py +++ b/pyouroboros/logger.py @@ -27,13 +27,13 @@ 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.upper()) except ValueError: - level = "info" + level = "INFO" self.logger.setLevel(level.upper()) # Create a Formatter for formatting the log messages