Skip to content

Commit

Permalink
fix: log duplication problem
Browse files Browse the repository at this point in the history
  • Loading branch information
mocobk committed Jan 7, 2024
1 parent 04ad577 commit 4063ca7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@


class Logger:
HANDLER = logging.StreamHandler()

def __init__(self):
self.formatter = logging.Formatter(
"%(asctime)s [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S"
Expand All @@ -13,7 +15,7 @@ def __init__(self):
self.logger = logging.getLogger("sonic-driver-core")
self.set_log_level(logging.INFO)

ch = logging.StreamHandler()
ch = self.HANDLER
ch.setFormatter(self.formatter)
self.logger.addHandler(ch)

Expand Down

0 comments on commit 4063ca7

Please sign in to comment.