Expose all logs to frontend instead of only maubot.*
This commit is contained in:
parent
0779b38b7a
commit
58fedc7e8c
1 changed files with 2 additions and 3 deletions
|
@ -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 a new issue