diff --git a/image_classifier/image_classifier.py b/image_classifier/image_classifier.py index 95125ac..60306f1 100755 --- a/image_classifier/image_classifier.py +++ b/image_classifier/image_classifier.py @@ -384,18 +384,18 @@ removing it..." self._log.addHandler(sysloghandler) streamhandler = logging.StreamHandler(sys.stdout) - streamhandler.setLevel(logging.getLevelName(self.debug_level)) - # formatter = '%(asctime)s | %(levelname)8s | %(message)s' - formatter = '[%(levelname)s] %(message)s' - streamhandler.setFormatter(CustomFormatter(formatter)) + streamhandler.setLevel( + logging.getLevelName(self.debug_level) + ) self._log.addHandler(streamhandler) - if not os.path.exists(os.path.dirname(self.log_file)): - os.mkdir(os.path.dirname(self.log_file)) + log_file = self.log_file + + if not os.path.exists(os.path.dirname(log_file)): + os.mkdir(os.path.dirname(log_file)) filehandler = logging.handlers.RotatingFileHandler( - self.log_file, - maxBytes=102400000 + log_file, maxBytes=102400000 ) # create formatter formatter = logging.Formatter(