Skip to main content

Asynchronous logging with queueing and deduplication

Project description

aqdlog (aqdlog)

Asynchronous logging helper for Python providing:

  • Non-blocking logging via QueueHandler + QueueListener
  • Simple deduplication of repeated (level, message) pairs
  • Timestamp / level / function / line formatting
  • Optional file output (console by default)

Installation

Using uv (recommended):

uv add aqdlog

Standard pip (after publishing):

pip install aqdlog

Quick Start

from aqdlog import log

logger = log("my_app", level="INFO")
logger.info("Service start")
logger.warning("Low disk space")
logger.warning("Low disk space")  # Duplicate suppressed

API

log(name: str, level: str = "INFO", log_file: str | None = None) -> logging.Logger

Args:

  • name: Logger name (use name)
  • level: Case-insensitive level name (INFO/DEBUG/WARNING/ERROR/CRITICAL)
  • log_file: File path; omit for stderr

Returns a Logger configured with QueueHandler and a running QueueListener.

Deduplication

DuplicateFilter remembers (level, message) pairs; repeats are dropped for the lifetime of the logger instance. Structured extras are ignored.

Shutdown

Implementation currently assigns logger.shutdown = shutdown() (invoked immediately). Prefer logging.shutdown() on process exit to flush handlers.

Limitations

  • Unlimited queue size (-1)
  • Naive duplicate suppression
  • Re-calling log() with same name returns existing logger; later level/file changes ignored

Roadmap

Configurable dedup strategy, max queue size, dynamic reconfiguration, graceful listener stop, structured logging.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aqdlog-1.1.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aqdlog-1.1.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file aqdlog-1.1.0.tar.gz.

File metadata

  • Download URL: aqdlog-1.1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for aqdlog-1.1.0.tar.gz
Algorithm Hash digest
SHA256 9330d2f5fefaad868ab906b6ef6a8a09e07bbb19fdaea6e5652ae5274d8fe026
MD5 cece9585fb2db06e2ed9456c5387d2df
BLAKE2b-256 d93db9e6d90807b91e1f939f319f966c3846dedc2a9c546d4d1b0b37ef1d639a

See more details on using hashes here.

File details

Details for the file aqdlog-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: aqdlog-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for aqdlog-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c20df9c122bf15d99192426599f69073550ece5458ac67faa3593b4704bfa3d4
MD5 eff903b783d999604fb11aca7657d4b4
BLAKE2b-256 83dff2ab94012a68931ea89544df56e94b77cd82d9cb9407c0cce6de234cb2d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page