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.2.tar.gz (4.7 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.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cham_logging-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ab472061cf83d5fcb1bdb1e64f49531a46942226d10b3a356effad79717579d6
MD5 3fa138bc9d52a61d44f018e1258b7359
BLAKE2b-256 858e33d43e12eaf3b368d6efd7c11b3118016e1cfbfaaebd4c2501c8cf86976b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cham_logging-0.1.2.tar.gz:

Publisher: publish.yml on Chamkang6093/cham-logging

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

File details

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

File metadata

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

File hashes

Hashes for cham_logging-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f9c5d59801c7e3820f95a42ae4c2aa4a9d75d61b1bed4ffca4e0cf116c39ce01
MD5 c640f596b31a8d062bd2606d00d08fd5
BLAKE2b-256 02e810a9481fb78873bc3bd64196e071400518fb76ba5bb58d0c6a7556e16844

See more details on using hashes here.

Provenance

The following attestation bundles were made for cham_logging-0.1.2-py3-none-any.whl:

Publisher: publish.yml on Chamkang6093/cham-logging

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