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.0.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.0.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aqdlog-1.0.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","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.0.0.tar.gz
Algorithm Hash digest
SHA256 2adbd6ae94ce3547e52a261f8468360c82b8e74b3e951ecc44c40c02d1810a79
MD5 c6c19016e01a74090fcfa8b92c976265
BLAKE2b-256 2120feeda2990a45957b53902b27e6dffd50b17d4e0cb6e3c172cf062601705c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aqdlog-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5dcacb9c21259a881d94060fafa61a4f9e3a9163901f78e5e5316f213b469d30
MD5 c4a0afa3a056b98487a008c822323368
BLAKE2b-256 258456d834fd8267c381681c254d018d4346f28a73f984cbe28d6b4e568a1810

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