feat: 增加日志模块

This commit is contained in:
2026-04-18 12:52:39 +08:00
parent b700dab484
commit 212459a8e4
18 changed files with 938 additions and 42 deletions

View File

@@ -72,6 +72,12 @@ class OmniTransport:
def send(self, *, to: str, data: bytes) -> None:
self._session.send(to=to, data=data)
def send_with_id(self, *, to: str, data: bytes) -> int:
if not hasattr(self._session, 'send_with_id'):
self._session.send(to=to, data=data)
raise RuntimeError('send_with_id is not available on this omnisocket build')
return int(self._session.send_with_id(to=to, data=data))
def recv(self, *, timeout_ms: int = -1):
return self._session.recv(timeout_ms=timeout_ms)