Skip to main content

A small stdlib-only helper for configuring Python logging.

Project description

cham-logging

A small stdlib-only helper for configuring Python logging.

Usage

Call init_logger() once near the start of your process.

import logging

from cham_logging.bootstrap import init_logger


init_logger()

logger = logging.getLogger(__name__)
logger.info("service started")

Environment variables

LOG_LEVEL controls the root logger and handler level.

LOG_LEVEL=DEBUG python -m your_app

If LOG_LEVEL is not set, INFO is used.

LOG_FILE enables an additional UTF-8 file handler.

LOG_FILE=app.log python -m your_app

Both variables can be used together.

LOG_LEVEL=DEBUG LOG_FILE=app.log python -m your_app

Format

Logs use UTC with microsecond precision:

2026-06-14T13:30:00.123456+00:00 - INFO - service started

The timezone is fixed to UTC for now and cannot be configured.

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

cham_logging-0.1.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

cham_logging-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file cham_logging-0.1.1.tar.gz.

File metadata

  • Download URL: cham_logging-0.1.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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":null}

File hashes

Hashes for cham_logging-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2b27214c76503590ea5c94521a51edd3f52a050a3307aac494c76104508053bf
MD5 13738a56c42866e13ac0f36cb336f1fb
BLAKE2b-256 5e301b57d0c3adff984cb2f5cfd18962b98e0c09a7a0d96823c9b4cddaa52664

See more details on using hashes here.

File details

Details for the file cham_logging-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cham_logging-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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":null}

File hashes

Hashes for cham_logging-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6171acb49e352555558259aee54f7369c7df331a623c358f3e8e416b971916ea
MD5 58d451e987d86e9651b81455014dc2d8
BLAKE2b-256 57e718e4f64b5b004f17afbb94f72072dc94cf7ec1ab7e8609422ec7cd8290b1

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