Skip to content

Commit

Permalink
close log handlers before removing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennifer A Clark committed Nov 13, 2020
1 parent 39439d3 commit 4cd87df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mapsci/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def initiate_logger(console=None, log_file=None, verbose=30):
elif console:
logger.warning("StreamHandler already exists")
elif handler_console == False:
handler_console.close()
logger.removeHandler(handler_console)

# Rotating File Handler
Expand All @@ -73,5 +74,6 @@ def initiate_logger(console=None, log_file=None, verbose=30):
elif log_file:
logger.warning("RotatingFileHandler already exists")
elif handler_logfile == False:
handler_logfile.close()
logger.removeHandler(handler_logfile)

0 comments on commit 4cd87df

Please sign in to comment.