Skip to content

Commit

Permalink
windows does not like colons in file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
thurber committed Jun 15, 2021
1 parent 7c950cf commit 2ccc83d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions diyepw/_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
if not os.path.exists(log_dir): # pragma: no cover
os.mkdir(log_dir)

_log_path = os.path.join(log_dir, str(datetime.now()).replace(' ', '_') +'.log')
_log_path = os.path.join(log_dir, str(datetime.now()).replace(' ', '_').replace(':', '_') +'.log')
_file_handler = logging.FileHandler(_log_path)
_file_handler.setFormatter(logging.Formatter("%(asctime)s [diyepw.%(levelname)s] %(message)s"))
_file_handler.setLevel(_LOG_LEVEL)
Expand All @@ -21,4 +21,4 @@

_logger = logging.Logger('diyepw')
_logger.addHandler(_stdout_handler)
_logger.addHandler(_file_handler)
_logger.addHandler(_file_handler)

0 comments on commit 2ccc83d

Please sign in to comment.