From e5a5fa5c4b40918247be8486d27a1676b6d2b044 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 28 Aug 2018 12:23:57 +0100 Subject: modules/logging.py -> IRCLogging.py; IRCLog.py -> IRCBuffer.py; change logging to be an object on the server object instead of an event call --- Database.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'Database.py') diff --git a/Database.py b/Database.py index 3c6787c3..9f0f7f8b 100644 --- a/Database.py +++ b/Database.py @@ -261,9 +261,8 @@ class Database(object): def _execute_fetch(self, query, fetch_func, params=[]): printable_query = " ".join(query.split()) - self.bot.events.on("log.debug").call( - message="executing query: \"%s\" (params: %s)", - params=[printable_query, params]) + self.bot.log.debug("executing query: \"%s\" (params: %s)", + [printable_query, params]) start = time.monotonic() cursor = self.cursor() @@ -272,9 +271,8 @@ class Database(object): end = time.monotonic() total_milliseconds = (end - start) * 1000 - self.bot.events.on("log.debug").call( - message="executed in %fms", - params=[total_milliseconds]) + self.bot.log.debug("executed in %fms", [total_milliseconds]) + return value def execute_fetchall(self, query, params=[]): return self._execute_fetch(query, -- cgit v1.3.1-10-gc9f91