Expose all logs to frontend instead of only maubot.*
This commit is contained in:
parent
0779b38b7a
commit
58fedc7e8c
@ -109,19 +109,18 @@ class LogCollector(logging.Handler):
|
||||
|
||||
|
||||
handler = LogCollector()
|
||||
log_root = logging.getLogger("maubot")
|
||||
log = logging.getLogger("maubot.server.websocket")
|
||||
sockets = []
|
||||
|
||||
|
||||
def init(loop: asyncio.AbstractEventLoop) -> None:
|
||||
log_root.addHandler(handler)
|
||||
logging.root.addHandler(handler)
|
||||
handler.loop = loop
|
||||
|
||||
|
||||
async def stop_all() -> None:
|
||||
log.debug("Closing log listener websockets")
|
||||
log_root.removeHandler(handler)
|
||||
logging.root.removeHandler(handler)
|
||||
for socket in sockets:
|
||||
try:
|
||||
await socket.close(code=1012)
|
||||
|
Loading…
Reference in New Issue
Block a user