diff options
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) |
