Update config_provider

This commit is contained in:
2023-07-19 21:04:05 +03:00
parent ea2d715cae
commit 2a2d55946e
8 changed files with 37 additions and 22 deletions

View File

@@ -33,11 +33,15 @@ if os.path.exists(log_file):
if os.path.exists(file):
tar.add(file, os.path.basename(file))
os.remove(file)
fh = logging.FileHandler(log_file, encoding='utf-8')
fh = logging.FileHandler(log_file, encoding="utf-8")
fh.setFormatter(logging.Formatter(log_format))
def get_logger(name):
try:
fh.encoding = config.enc
except NameError:
fh.encoding = "utf-8"
log = logging.getLogger(name=name)
log.addHandler(fh)
log.level = log_level