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.0.tar.gz (4.0 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.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cham_logging-0.1.0.tar.gz
  • Upload date:
  • Size: 4.0 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.0.tar.gz
Algorithm Hash digest
SHA256 6f67b22ebd96d393d476d9f4919af1afabf35c2230f81b47d0b7af078db9811f
MD5 0f5162ac904202c1c7f59ca1c9480ce8
BLAKE2b-256 9783613f4181c93617d571e0070f9a0c4313de51d2baa51543725bb8b41c952f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cham_logging-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91551c0170cf082bb7bb43a0eec255be665f2047451217794e5de20e5b4fe90e
MD5 e7731bb480bb2294ea8aa517b206c43a
BLAKE2b-256 22b3a2e90c8e0671e671af7c5e936671b5fb680e7c785dccd868ad0ae5febc7e

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