Skip to content

Commit

Permalink
Merge pull request #10 from mocobk/main
Browse files Browse the repository at this point in the history
fix: log duplication problem
  • Loading branch information
ZhouYixun authored Jan 8, 2024
2 parents 04ad577 + 4063ca7 commit 3c6bb38
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 3c6bb38

Please sign in to comment.