Architectural overview

Updated Jul 05, 2026
  • Each FemtoLogger owns a bounded queue (capacity 1 024) and a worker thread that drains records and invokes handlers. Calls to logger.log() simply enqueue a record and return immediately.
  • Handlers (FemtoStreamHandler, FemtoFileHandler, FemtoRotatingFileHandler, and FemtoSocketHandler) also own dedicated queues and worker threads so file IO, stdout/stderr writes, and socket operations never block the calling code.
  • When any queue is full, the record is dropped. Each component emits rate-limited warnings and maintains drop counters (FemtoLogger.get_dropped() and handler-specific warnings) so you can monitor pressure.
  • Record metadata tracks the logger name, level, message text, timestamps, thread identity, and optional structured exception (exc_info) and call stack (stack_info) payloads. The Python API does not yet expose other rich LogRecord attributes such as extra or the calling module.