From af2b34b92b30aa5a51d385e6137f0716dd7a7935 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 27 Sep 2018 11:07:29 +0100 Subject: Don't give IRCBot instance to things that don't need it, use a better way of doing default locations for config/database/log --- src/Logging.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Logging.py') diff --git a/src/Logging.py b/src/Logging.py index 3f5815d6..e08160f4 100644 --- a/src/Logging.py +++ b/src/Logging.py @@ -14,7 +14,7 @@ class BitBotFormatter(logging.Formatter): return s class Log(object): - def __init__(self, bot, directory, filename): + def __init__(self, location): self.logger = logging.getLogger(__name__) self.logger.setLevel(logging.DEBUG) @@ -29,7 +29,7 @@ class Log(object): self.logger.addHandler(stdout_handler) file_handler = logging.handlers.TimedRotatingFileHandler( - os.path.join(directory, filename), when="midnight", backupCount=5) + location, when="midnight", backupCount=5) file_handler.setLevel(logging.DEBUG) file_handler.setFormatter(formatter) self.logger.addHandler(file_handler) -- cgit v1.3.1-10-gc9f91