Skip to main content

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_id or user_id) to all logs.
  • Standard API: Compatible with standard python logging (mostly) and structlog.

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

dev_utils_jokerssd-0.4.0.tar.gz (66.2 kB view details)

Uploaded Source

Built Distribution

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

dev_utils_jokerssd-0.4.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file dev_utils_jokerssd-0.4.0.tar.gz.

File metadata

  • Download URL: dev_utils_jokerssd-0.4.0.tar.gz
  • Upload date:
  • Size: 66.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.17

File hashes

Hashes for dev_utils_jokerssd-0.4.0.tar.gz
Algorithm Hash digest
SHA256 b83874a1399333f515eefe0434cc206cb6d470097848458d8fcddaf724c3b74c
MD5 593dd41ebd3eca85cc480ccf3c34d058
BLAKE2b-256 9baaa87b386f31f24c28c28e5b4644e6739774f8ccd8742c7d75dfc7dfe05339

See more details on using hashes here.

File details

Details for the file dev_utils_jokerssd-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dev_utils_jokerssd-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a49ef61e27fb8a953f3f541d132b5f904304f5a514d8643c14500b53352cdf44
MD5 cdea16913e55bf2ca7fed4bb36c49cbe
BLAKE2b-256 ca089b4739b954183f738fe9152f12c60faeb3ee70b53a94b8a0075093bfd6d0

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