mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 02:48:23 +08:00
Fix: Log charset set to UTF-8
The default character encoding of "logging" is cp1252, which is not able to encode CJK chars.
This commit is contained in:
@@ -39,10 +39,10 @@ if '_' in pyw_name:
|
||||
pyw_name = '_'.join(pyw_name.split('_')[:-1])
|
||||
log_file = f'./log/{datetime.date.today()}_{pyw_name}.txt'
|
||||
try:
|
||||
file = logging.FileHandler(log_file)
|
||||
file = logging.FileHandler(log_file, encoding='utf-8')
|
||||
except FileNotFoundError:
|
||||
os.mkdir('./log')
|
||||
file = logging.FileHandler(log_file)
|
||||
file = logging.FileHandler(log_file, encoding='utf-8')
|
||||
file.setFormatter(formatter)
|
||||
logger.addHandler(file)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user