Logging
Titanspan provides an early native logging component with structured records, named channels, standard severity levels, context-local metadata, file and stream destinations, bounded background dispatch, and a Python logging bridge.
The application API belongs to Titanspan. The component delegates structured dispatch to Structlog and file, stream, rotation, and syslog handling to Python’s standard logging infrastructure. Application code uses Titanspan types and configuration; it does not configure backend processors or handlers.
Quick start
Section titled “Quick start”Application owns a LogManager and binds it to the active HTTP execution
scope. Standalone use can bind a manager explicitly:
from titanspan import Applicationfrom titanspan.facades import Logfrom titanspan.logging import LogManager
manager = LogManager( { "default": "console", "channels": { "console": { "driver": "console", "level": "info", "formatter": "console", }, }, },)
application = Application()with application.context(), Log.use(manager): Log.info("Application started", component="api")
manager.close()Log.use() replaces the application manager through the Container. It is
useful for isolated tests and explicit execution-local substitution. Normal
application code resolves the configured manager without a replacement.
The configured severity uses RFC 5424 values. LogLevel defines emergency,
alert, critical, error, warning, notice, info, and debug.
Guides
Section titled “Guides”- Configuration: validated channel settings.
- Channels and stacks: channel resolution and fan-out.
- Drivers: supported output destinations.
- Context: task-local and shared metadata.
- Structured records: values, exceptions, and schema.
- Async logging: thread offloading and bounded queues.
- Security: redaction and payload limits.
- Testing: in-memory logging fakes and assertions.
- Deployment: stdout collection and process boundaries.
- Native logging specification: implemented boundaries and deferred work.
Current limits
Section titled “Current limits”This component is still early-stage. It does not yet provide a deprecation channel, the complete event-dispatcher integration, or every destination available from its implementation dependencies. The native specification records current boundaries. Do not infer features from similarly named APIs.
