This commit is contained in:
2026-04-13 15:36:36 +08:00
parent b781821132
commit c4cbd2dc43
2 changed files with 1 additions and 2 deletions

View File

@@ -1 +0,0 @@
from jsonrpc2 import Request, Response, Error, History, ConnectionContext, define, remove, run

View File

@@ -152,7 +152,7 @@ def run(logger: logging.Logger) -> str:
history = History()
fmt = logger.handlers[0].formatter
logger.addHandler(history)
handlers.setdefault('sync', lambda: list(map(lambda x: fmt.format(x), history.truncate())))
define('sync', lambda: list(map(lambda x: fmt.format(x), history.truncate())))
thread = Thread(target=lambda: trio.run(backend), daemon=True)
thread.start()