fix boulette

This commit is contained in:
Milka64 2021-01-30 21:35:52 +01:00
parent 7ab8aa21b9
commit 7031a76b06

View file

@ -557,16 +557,18 @@ def main():
)
args = parser.parse_args()
config = configparser.ConfigParser()
if not os.path.exists(args.config):
logger.critical('config file not found')
exit(1)
config.read(args.config)
log_file = config['DEFAULT']['logs']
## definition du fichier de log (chemin, level, etc ...)
file_handler = RotatingFileHandler(log_file, 'a', 1000000, 1)
file_handler.setLevel(logging.INFO)
file_handler.setFormatter(formatter)
logger.addHandler(file_handler)
if not os.path.exists(args.config):
logger.critical('config file not found')
exit(1)
config.read(args.config)
if "nickname" in config['DEFAULT']:
nickname = config['DEFAULT']['nickname']
else: