diff --git a/src/Logging.py b/src/Logging.py index a4af69f7..0b934de4 100644 --- a/src/Logging.py +++ b/src/Logging.py @@ -43,11 +43,16 @@ class Log(object): stdout_handler.setFormatter(formatter) self.logger.addHandler(stdout_handler) - file_handler = logging.handlers.TimedRotatingFileHandler( - location, when="midnight", backupCount=5) - file_handler.setLevel(LEVELS["trace"]) - file_handler.setFormatter(formatter) - self.logger.addHandler(file_handler) + trace_handler = logging.handlers.TimedRotatingFileHandler( + os.path.join(location, "trace.log"), when="midnight", backupCount=5) + trace_handler.setLevel(LEVELS["trace"]) + trace_handler.setFormatter(formatter) + self.logger.addHandler(trace_handler) + + warn_handler = logging.FileHandler(os.path.join(location, "warn.log")) + warn_handler.setLevel(LEVELS["warn"]) + warn_handler.setFormatter(formatter) + self.logger.addHandler(warn_handler) def trace(self, message: str, params: typing.List, **kwargs): self._log(message, params, LEVELS["trace"], kwargs) diff --git a/start.py b/start.py index 56057290..fc83eb9b 100755 --- a/start.py +++ b/start.py @@ -17,9 +17,9 @@ arg_parser.add_argument("--database", "-d", help="Location of the sqlite3 database file", default=os.path.join(directory, "databases", "bot.db")) -arg_parser.add_argument("--log", "-l", - help="Location of the main log file", - default=os.path.join(directory, "logs", "bot.log")) +arg_parser.add_argument("--log-dir", "-l", + help="Location of the log directory", + default=os.path.join(directory, "logs")) arg_parser.add_argument("--add-server", "-a", help="Add a new server", action="store_true")