Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Create logger.py
Browse files Browse the repository at this point in the history
  • Loading branch information
timhll-amz authored Jun 13, 2024
1 parent cf66fd5 commit 7d2d394
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions DRS/DRS-Settings-Tool/utils/logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import logging
import sys
import os

path = os.path.dirname(__file__).replace('\\utils', '')


def get_logger(name):
log_format = '%(asctime)s %(name)8s %(levelname)5s %(message)s'
logging.basicConfig(level=logging.NOTSET,
format=log_format,
filename=path + '\\DRS-Update-Tool.log',
filemode='a')
console = logging.StreamHandler(sys.stdout)
console.setFormatter(logging.Formatter(log_format))
logging.getLogger(name).addHandler(console)
return logging.getLogger(name)

0 comments on commit 7d2d394

Please sign in to comment.