soulfire.logs_connect.LogsServiceClientSync¶
- class soulfire.logs_connect.LogsServiceClientSync(address: str, *, codec: connectrpc.codec.Codec | None = _PROTO_BINARY_CODEC, protocol: connectrpc.protocol.ProtocolType = ProtocolType.CONNECT, accept_compression: collections.abc.Iterable[connectrpc.compression.Compression] | None = None, send_compression: connectrpc.compression.Compression | None = _GZIP_COMPRESSION, timeout_ms: int | None = None, read_max_bytes: int | None = None, interceptors: collections.abc.Iterable[connectrpc.interceptor.InterceptorSync] = (), http_client: pyqwest.SyncClient | None = None)[source]¶
Bases:
connectrpc.client.ConnectClientSyncService for accessing SoulFire server logs. Provides both historical log retrieval and real-time log streaming capabilities. All methods require appropriate authentication and permissions based on the requested scope.
- get_previous(request: soulfire.logs_pb2.PreviousLogRequest, *, headers: connectrpc.request.Headers | collections.abc.Mapping[str, str] | None = None, timeout_ms: int | None = None) soulfire.logs_pb2.PreviousLogResponse[source]¶
Retrieves historical log entries from the server’s in-memory log buffer. The server maintains a rolling buffer of the last 300 log entries. Only returns non-personal logs that match the specified scope.
Permissions required: - GlobalLogScope: GLOBAL_SUBSCRIBE_LOGS - InstanceLogScope/BotLogScope/InstanceScriptLogScope: INSTANCE_SUBSCRIBE_LOGS for the instance - PersonalLogScope: No special permissions (but returns empty since personal logs are not stored)
Errors: - PERMISSION_DENIED: User lacks required permission for the requested scope - INVALID_ARGUMENT: Scope not set or invalid UUID format - INTERNAL: Server error while retrieving logs
- subscribe(request: soulfire.logs_pb2.LogRequest, *, headers: connectrpc.request.Headers | collections.abc.Mapping[str, str] | None = None, timeout_ms: int | None = None) collections.abc.Iterator[soulfire.logs_pb2.LogResponse][source]¶
Subscribes to a real-time stream of log entries matching the specified scope. The stream remains open until cancelled by the client or the connection is lost. Permissions are re-validated periodically (every 1 second) to handle permission changes.
For PersonalLogScope: Receives personal messages directed to the authenticated user. Personal messages are transient and only delivered to active subscribers.
Permissions required: - GlobalLogScope: GLOBAL_SUBSCRIBE_LOGS - InstanceLogScope/BotLogScope/InstanceScriptLogScope: INSTANCE_SUBSCRIBE_LOGS for the instance - PersonalLogScope: No special permissions required
Errors: - PERMISSION_DENIED: User lacks required permission for the requested scope - INVALID_ARGUMENT: Scope not set or invalid UUID format - INTERNAL: Server error while setting up subscription