[logging] Add realpath to `ControlledLogger` log file path

pull/2/head
Daniel Van Der Maden 5 years ago
parent ab0a2e08be
commit 9a20f03985
  1. 1
      pyhmy/logging.py

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

Loading…
Cancel
Save