Skip to content
femtologging
Menu

The femtofauna survey · A Python logging runtime

Logging,
under the
microscope.

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.

0.2.0-beta1
Next release, forthcoming
Python 3.12+
Source build today
Rust workers
One per handler
Three ceramic robot pandas push glowing amber record crates along an etched rail. A robot capybara rests beside a ring of crates and a long-neck robot dinosaur watches from a bridge.

FL-S-001SE · false colour · simulated5 fm illustrative scale

Plate 01Record transport in cross-section. Three units in transit; the buffer occupant remains seated.
  1. Transport units. Records en route to a handler worker
  2. Queue occupant. Bounded buffer, at rest
  3. Interface inspector. Compatibility bridge, under review

01 / Field summary

Why femtologging?

Serious logging.
Unexpected company.

02 / Magnification series

Explore a smaller world.

From your application
to the femtoscale.

  1. A laptop showing blurred code on a dark laboratory bench beneath the objective lens of an electron microscope.10⁰ mYour Python application
  2. An oblique view of a microfabricated die: blocks of etched machinery, gold bond wires, and teal channels carrying pinpoints of amber light.10⁻³ mThe pipeline
  3. A branching network of etched rails lined with teal crystals. Small glowing crates travel the rails toward a circular buffer full of crates.10⁻⁶ mTransport channels
  4. Three robot pandas at a rail junction: one lifts a glowing crate, one pushes a loaded trolley, one works a switch lever.10⁻⁹ mWorkers at a junction
  5. A close-up of a robot panda with ceramic face plates and gold whiskers, one paw on a glowing amber crate, looking up toward the viewer.10⁻¹⁵ mA closer look
Plates 05–09 Five fields of view, from the application to a single transport unit. Powers of ten are illustrative; calibration remains disputed.

03 / First observation

A record enters
the system.

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()
Outputsurvey.transport [INFO] record received

04 / Runtime cross-section

The path is small.
The boundaries matter.

Python creates the record.
Rust routes it to handlers.

  1. 01PythonMessage, extra, exception
  2. 02LoggerLevels and propagation
  3. 03QueueFinite capacity
  4. 04HandlerWorker-backed output
  5. 05OutputStream, file, or network
A side-on cutaway of one channel. From left: a robot dinosaur at a coupling, four robot pandas pushing glowing crates, a robot capybara in a buffer bay of crates, and teal crystals at the exit.

FL-X-003SE · false colour · simulated2 fm illustrative scale

Plate 03One channel, sectioned along its length. Read left to right, as the record travels.
  1. Coupling. Where Python hands the record to Rust
  2. Transport. Records crossing the channel in order
  3. Buffer bay. A bounded handler queue
  4. Crystal field. Output: stream, file, or network

Capacity is a choice.

Full queues can reject records. Handler policies and drop counters need an operational plan.

Handle pressure and shutdown

Output has an owner.

Stream, file, rotating file, socket, and HTTP handlers have different failure and shutdown contracts.

Choose an output

Familiar has limits.

Named loggers and handler adapters support adoption. Full stdlib parity remains a goal.

Check compatibility

05 / Specimen notes

Machinery. With residents.

The survey is fiction. The queue policy is configuration.

Field notes
from the pipeline.

A robot panda seated on an aluminium specimen stub, holding a glowing amber record crate in its lap.

FL-P-010SE · false colour · simulated2 fm illustrative scale

Plate 10Transport unit, mounted for imaging. It declined to surrender the crate.

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 path
A robot capybara resting on an aluminium specimen stub, one paw against a stack of three glowing record crates.

FL-Q-011SE · false colour · simulated4 fm illustrative scale

Plate 11Queue occupant, mounted for imaging. The stack has not changed height.

Fig. 2 · Queues and back-pressure

Robot capybara

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
A small long-neck robot dinosaur on an aluminium specimen stub, inspecting a teal-lit two-sided adapter.

FL-C-012SE · false colour · simulated3 fm illustrative scale

Plate 12Interface inspector, mounted for imaging. Both halves of the adapter were found to fit.

Fig. 3 · Compatibility and interfaces

Robot dinosaur

Femtosaurus compatibilis

Inspects every adapter between the stdlib surface and the runtime. Keeps meticulous notes on what does not fit.

Check the supported surface

Continue the investigation

Start with one record.

One named logger, one handler, one flush. Then look closer.