Metadata-Version: 2.4
Name: cham-logging
Version: 0.1.2
Summary: A small stdlib-only helper for configuring Python logging.
Project-URL: Repository, https://github.com/Chamkang6093/cham-logging
Author: Cham
License-Expression: MIT
License-File: LICENSE
Keywords: logging,stdlib
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# cham-logging

A small stdlib-only helper for configuring Python logging.

## Usage

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

```python
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.

```bash
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.

```bash
LOG_FILE=app.log python -m your_app
```

Both variables can be used together.

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

## Format

Logs use UTC with microsecond precision:

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

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