Log file doesn't need to exist before logger can log to it

This commit is contained in:
Peter Schiffer 2016-09-01 09:07:33 +02:00
parent 444be2c060
commit 558279e009

View file

@ -27,7 +27,7 @@ class logger(object):
# set request requests module log level
logging.getLogger("requests").setLevel(logging.CRITICAL)
if self.logfile and os.path.isfile(self.logfile):
if self.logfile:
# define handler to log into file
file_log_handler = logging.FileHandler(self.logfile)
logger.addHandler(file_log_handler)