Skip to main content

Ergonomic Python logging with Rich-first defaults and a path to structured observability.

Project description

ultilog

ultilog is an ergonomic Python logging package that starts with a tiny API and scales toward structured observability.

The default experience is intentionally small:

from ultilog import get_logger

log = get_logger()
log.info("app.started")

No explicit settings object is required for ordinary use. The package lazily configures logging on first access, installs a useful console handler, and then returns a standard-library logger.

Install

pdm add ultilog

Other package managers:

pip install ultilog
uv add ultilog
poetry add ultilog

Future extras are designed to look like:

pip install "ultilog[structlog]"
pip install "ultilog[otel]"
pip install "ultilog[full]"

Quickstart

from ultilog import get_logger

log = get_logger()
log.info("hello")

Explicit naming is supported:

log = get_logger(__name__)

Custom names are supported:

log = get_logger("my.service")

Optional setup is available when needed:

from ultilog import setup, get_logger

setup(level="DEBUG", force=True)
log = get_logger()

Modes

The scaffold supports three modes:

  • rich: pretty local console logs
  • plain: simple stream logging
  • json: machine-readable JSON logs
from ultilog import setup, get_logger

setup(mode="json", force=True)
get_logger("api").info("request.finished")

Context

Context belongs at runtime boundaries, not logger creation time.

from ultilog import get_logger, logging_context

log = get_logger("worker")

with logging_context(job_id="job_1", queue="emails"):
    log.info("job.started")

Current Scaffold Includes

  • zero-config get_logger()
  • optional setup(...)
  • explicit configure(settings) for advanced use
  • Rich console handler factory
  • plain and JSON output modes
  • contextvars-based context helpers
  • ASGI/FastAPI integration shapes
  • optional dependency helpers
  • diagnostics CLI
  • unit, integration, and e2e test layout
  • docs, examples, CI skeleton, and future integration namespaces

CLI

python -m ultilog doctor --json
python -m ultilog demo --mode plain
python -m ultilog demo --mode json

Development

pdm sync -G dev
pdm run pytest
pdm run ruff check .
pdm run mypy src/ultilog

For local source-tree experiments without installing the package:

PYTHONPATH=src python examples/01_zero_config.py
PYTHONPATH=src python -m ultilog doctor --json

Design Direction

ultilog should remain easy at the surface and layered underneath. The default API should stay tiny while internals grow to support structured logging, OpenTelemetry, context propagation, exporters, and framework integrations.

See docs/ for architecture, testing strategy, roadmap, and cookbook notes.

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

ultilog-0.1.0.tar.gz (34.5 kB view details)

Uploaded Source

Built Distribution

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

ultilog-0.1.0-py3-none-any.whl (53.9 kB view details)

Uploaded Python 3

File details

Details for the file ultilog-0.1.0.tar.gz.

File metadata

  • Download URL: ultilog-0.1.0.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ultilog-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2843caf8ad00ffc19758ae544aa382811624f541ae9b4812544c85aa27b844c9
MD5 9fa2522aee716f259065fbdf0abd509b
BLAKE2b-256 1eb9f7fef5f2b6c60c02cfc8815ed1113032fd840a9e87ccbf42efcd0b6e1421

See more details on using hashes here.

Provenance

The following attestation bundles were made for ultilog-0.1.0.tar.gz:

Publisher: release.yml on pr1m8/ultilog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ultilog-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ultilog-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 53.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ultilog-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79387df102546a5d4562d59596d3e174d87cf5a1178c101ffbb4b6e07326fc61
MD5 57bc5b8a47abec2790dc1a9167c1edc1
BLAKE2b-256 94e06cf05470878743298f59dfbb7c3d61370e4c5682c6ec5e96ed6479ca492d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ultilog-0.1.0-py3-none-any.whl:

Publisher: release.yml on pr1m8/ultilog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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