Fig. 1 · Transport and handoff
Robot panda
Ailuropoda logistica
Carries one record at a time from the producer to a handler’s queue. Rarely seen without a crate.
Follow the record pathThe femtofauna survey · A Python logging runtime
Python above. Rust below.
A logging runtime for Python that delegates record dispatch and output to Rust worker threads, with bounded queues, structured records, and an explicit compatibility surface.
01 / Field summary
Serious logging.
Unexpected company.
Dotted names, levels, and propagation, through get_logger or getLogger.
Route loggers: familiar loggersValidated extra fields, exc_info, and stack_info travel with each record.
Add context: structured recordsEvery handler owns a finite queue and a stated overflow policy.
Plan for pressure: bounded queuesFile and network I/O run on handler threads, off the producer path.
See the runtime: rust workersReuse an existing logging.Handler through StdlibHandlerAdapter.
Check the surface: stdlib adapterOptional log and tracing bridges route Rust events to the same handlers.
Read the bridges: rust bridges02 / Magnification series
From your application
to the femtoscale.
10⁰ mYour Python application
10⁻³ mThe pipeline
10⁻⁶ mTransport channels
10⁻⁹ mWorkers at a junction
10⁻¹⁵ mA closer look03 / First observation
Configure output, emit a message, then drain the named logger and its root output before exit. The application owns the lifecycle.
The 0.2.0 surface adds validated extra fields to named loggers. Context travels with the record; the message remains a string.
Build from source and run the example
Source revision f5bcaa8
Release target 0.2.0-beta1
"""Run the first record example against the documented femtologging source."""
import sys
from femtologging import (
basicConfig,
get_logger,
)
basicConfig(level="INFO", stream=sys.stdout)
logger = get_logger("survey.transport")
root = get_logger("root")
try:
logger.info("record received", extra={"specimen": 42})
if not logger.flush_handlers() or not root.flush_handlers():
message = "Logging did not flush"
raise RuntimeError(message)
finally:
root.clear_handlers()
04 / Runtime cross-section
Python creates the record.
Rust routes it to handlers.
Full queues can reject records. Handler policies and drop counters need an operational plan.
Handle pressure and shutdownStream, file, rotating file, socket, and HTTP handlers have different failure and shutdown contracts.
Choose an outputNamed loggers and handler adapters support adoption. Full stdlib parity remains a goal.
Check compatibility05 / Specimen notes
The survey is fiction. The queue policy is configuration.
Field notes
from the pipeline.
Fig. 1 · Transport and handoff
Ailuropoda logistica
Carries one record at a time from the producer to a handler’s queue. Rarely seen without a crate.
Follow the record path
Fig. 2 · Queues and back-pressure
Queueus chillus
Occupies the bounded queue in front of each handler. Its calm is not an overflow policy; yours is.
Plan for a full queue
Fig. 3 · Compatibility and interfaces
Femtosaurus compatibilis
Inspects every adapter between the stdlib surface and the runtime. Keeps meticulous notes on what does not fit.
Check the supported surfaceContinue the investigation
One named logger, one handler, one flush. Then look closer.