fix logging dupe bug

This commit is contained in:
沈瑗杰 2021-09-22 20:51:30 +08:00
parent 19bb142121
commit 8d732506aa
2 changed files with 5 additions and 5 deletions

View File

@ -39,7 +39,7 @@ class Game:
# lang_config
self.language = tools.config('configs/sys_value/basic_config.json5')
self.language = self.language['language']
translate.tr.set_language(self.language)
tr.set_language(self.language)
# logging config
log_config = tools.config('configs/logger.json5')
file_name = log_config['handlers']['file']['filename']
@ -48,7 +48,7 @@ class Game:
try:
logging.config.dictConfig(log_config)
self.logger = logging.getLogger('main')
except ValueError:
except ValueError: # it should be no 'logs/' folder
os.mkdir('logs')
logging.config.dictConfig(log_config)
self.logger = logging.getLogger('main')

View File

@ -35,15 +35,15 @@
'loggers': {
'client': {
'level': 'DEBUG',
'handlers': ['console', 'file']
'handlers': []
},
'server': {
'level': 'DEBUG',
'handlers': ['console', 'file']
'handlers': []
},
'main': {
'level': 'DEBUG',
'handlers': ['console', 'file']
'handlers': []
}
},
'root': {