https://github.com/fleetingbytes/readylog
easy logging configuration
https://github.com/fleetingbytes/readylog
Last synced: 4 months ago
JSON representation
easy logging configuration
- Host: GitHub
- URL: https://github.com/fleetingbytes/readylog
- Owner: fleetingbytes
- Created: 2019-06-30T05:56:00.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2026-02-02T04:35:39.000Z (4 months ago)
- Last Synced: 2026-02-02T13:41:17.227Z (4 months ago)
- Language: Python
- Size: 68.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# readylog
Readylog is a logging configuration template for Python's logging.
## Usage
Basic example:
```python
# my_app.py
from logging.config import dictConfig as configure_logging
from logging import getLogger
from pathlib import Path
from platformdirs import user_log_dir
from readylog import create_dict_config
def setup_logging() -> None:
app_name = "my_app"
author = "Me"
log_dir = Path(user_log_dir(app_name, author))
log_dir.mkdir(parents=True, exist_ok=True)
logging_config = create_dict_config(log_dir / "debug.log", app_name)
configure_logging(logging_config)
logger = getLogger(__name__)
setup_logging()
logger.debug("This should be logged")
```
## Documentation
```python
from readylog import create_dict_confg
print create_dict_config.__doc__
```