We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d6bb5b commit cf77a60Copy full SHA for cf77a60
1 file changed
plugins/log.py
@@ -1,16 +1,15 @@
1
import asyncio
2
-import os
3
import codecs
+import os
4
import time
5
6
import cloudbot
7
from cloudbot import hook
8
from cloudbot.event import EventType
9
-
10
11
# +---------+
12
# | Formats |
13
+from cloudbot.hook import Priority
14
from cloudbot.util.formatting import strip_colors
15
16
base_formats = {
@@ -253,3 +252,11 @@ def flush_log():
253
252
stream.flush()
254
for name, stream in raw_cache.values():
255
+
256
257
+@hook.on_stop(priority=Priority.LOWEST)
258
+def close_logs():
259
+ for name, stream in stream_cache.values():
260
+ stream.close()
261
+ for name, stream in raw_cache.values():
262
0 commit comments