[logging] Add .log suffix for log files

pull/2/head
Daniel Van Der Maden 5 years ago
parent b71d70b5c5
commit c05015a646
  1. 2
      pyhmy/logging.py

@ -17,7 +17,7 @@ class ControlledLogger:
if log_dir.endswith('/'): if log_dir.endswith('/'):
log_dir = log_dir[:-1] log_dir = log_dir[:-1]
os.makedirs(log_dir, exist_ok=True) os.makedirs(log_dir, exist_ok=True)
handler = logging.FileHandler(f"{log_dir}/{logger_name}") handler = logging.FileHandler(f"{log_dir}/{logger_name}.log")
handler.setFormatter(logging.Formatter('%(levelname)s - %(message)s')) handler.setFormatter(logging.Formatter('%(levelname)s - %(message)s'))
self.logger = logging.getLogger(logger_name) self.logger = logging.getLogger(logger_name)

Loading…
Cancel
Save