diff options
| author | 2018-08-05 11:30:43 +0100 | |
|---|---|---|
| committer | 2018-08-05 11:30:43 +0100 | |
| commit | 5e42608ead5021858aada91426300e908148139b (patch) | |
| tree | c4625d5578ffa6956b1894b1f37ad40a6c41f165 /modules/logs.py | |
| parent | Remove debug print, improve wikipedia.py (diff) | |
Improved logging, added TRACE logging in Database.py to see how it performs
Diffstat (limited to 'modules/logs.py')
| -rw-r--r-- | modules/logs.py | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/modules/logs.py b/modules/logs.py deleted file mode 100644 index 0c3ce004..00000000 --- a/modules/logs.py +++ /dev/null @@ -1,19 +0,0 @@ -import datetime - -class Module(object): - def __init__(self, bot): - bot.events.on("log").on("info", "warn", "error").hook(self.log) - - def timestamp(self): - return datetime.datetime.utcnow().isoformat()+"Z" - - def log(self, event): - log_level = event.name - timestamp = self.timestamp() - message = event["message"] - data = event.get("data") - with open("bot.log", "a") as log_file: - log_file.write("%s [%s] %s\n" % (timestamp, log_level, - message)) - if data: - log_file.write("%s\n" % data) |
