Skip to content

Commit

Permalink
fixed: logger initialization issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pozitronik committed Oct 9, 2024
1 parent fc222a4 commit 7ae8a20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sinner/Status.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ def log(self, level: int = logging.INFO, msg: str = "") -> None:

def init_logger(self, value: str) -> bool:
try:
if value:
if value and not self.logger:
self.logger = logging.getLogger(__name__)
self.logger.setLevel(logging.DEBUG)

file_handler = logging.FileHandler(value, encoding='utf-8')
file_handler = logging.FileHandler(value, encoding='utf-8', mode='w')
file_handler.setLevel(logging.DEBUG)

formatter = logging.Formatter('%(levelname)s: %(message)s')
Expand Down

0 comments on commit 7ae8a20

Please sign in to comment.