Development utilities with structured logging
Project description
Dev Utils
A collection of development utilities, starting with structured logging.
Installation
pip install dev-utils-jokerssd
Logging Utils
A powerful wrapper around structlog and Python's standard logging module to provide structured JSON logging with rotation, async writing, and easy configuration.
Usage
from dev_utils import LoggingUtils
# Basic Setup
logging_utils = LoggingUtils(
log_file="app.log",
log_level="INFO",
print_output=True,
json_formatter=True,
binding_dict={"app_name": "my_app"}
)
logger = logging_utils.get_logger()
# Log something
logger.info("Application started", version="1.0.0")
# Exception logging
try:
1 / 0
except ZeroDivisionError:
logger.exception("Something went wrong")
Features
- Structured JSON Logs: By default, logs are formatted as JSON for easy parsing by log management tools.
- Async Logging: Uses a background thread for file writing to avoid blocking the main execution path.
- Log Rotation: Automatically rotates log files daily (default).
- Context Binding: Bind global context variables (like
request_idoruser_id) to all logs. - Standard API: Compatible with standard python
logging(mostly) andstructlog.
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 dev_utils_jokerssd-0.2.0.tar.gz.
File metadata
- Download URL: dev_utils_jokerssd-0.2.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20008ce5cbb59149598bbf45d6b775dd6daef766ccea625529808c477e82682f
|
|
| MD5 |
1c429bc28dacdcd966534e9d8bd83848
|
|
| BLAKE2b-256 |
07931e6f155ceb9a857134080917ca81e16e7f974b389049973038e468be7279
|
File details
Details for the file dev_utils_jokerssd-0.2.0-py3-none-any.whl.
File metadata
- Download URL: dev_utils_jokerssd-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5b33b63fe4dcc98003235802583283eb372c3d6f27802d9899ed8d9cec0d715
|
|
| MD5 |
8444653766cc99432f1d5b26a757d7cd
|
|
| BLAKE2b-256 |
a723264548b1737bb2aef9387175fdb252b273d9973add52df02c37b851beb28
|