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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2adbd6ae94ce3547e52a261f8468360c82b8e74b3e951ecc44c40c02d1810a79
|
|
| MD5 |
c6c19016e01a74090fcfa8b92c976265
|
|
| BLAKE2b-256 |
2120feeda2990a45957b53902b27e6dffd50b17d4e0cb6e3c172cf062601705c
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dcacb9c21259a881d94060fafa61a4f9e3a9163901f78e5e5316f213b469d30
|
|
| MD5 |
c4a0afa3a056b98487a008c822323368
|
|
| BLAKE2b-256 |
258456d834fd8267c381681c254d018d4346f28a73f984cbe28d6b4e568a1810
|