Skip to content

Chamkang6093/cham-logging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A small stdlib-only helper for configuring Python logging.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages