Lightweight utility for structured logging with automatic log and graph directory management
Project description
project-logging
Lightweight Python utility for structured logging with automatic log and graph directory management.
Features
- Simple logging setup with file + console output
- Automatic creation of log directories
- Dedicated folder for saving graphs or outputs
- Clean, reusable API for projects and analysis pipelines
Installation
Install from PyPI:
pip install project-logging
Usage and Configuration
from project_logging import Logger
# Initialize logger with default settings
logger = Logger().setup_logging(log_filename="analysis.log")
# Log messages
logger.info("Starting analysis")
logger.warning("This is a warning")
# Access graph output directory
print(logger.graph_save_path)
# Custom configuration
logger = Logger().setup_logging(
main_log_folder="_LOGS",
log_filename="experiment.log",
log_folder="run_01",
graphs_folder="plots"
)
Output structure
_LOGS/
experiment/
experiment.log
experiment_graphs/
License
This project is licensed under the MIT License. ``
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
project_logging-0.1.0.tar.gz
(3.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file project_logging-0.1.0.tar.gz.
File metadata
- Download URL: project_logging-0.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13110f6f92f9a1658ab2fa346cadd1551f053f30fa5a170f1ed73c4bccea5bff
|
|
| MD5 |
8712b73e47443a57095f4b8b5c4ecdeb
|
|
| BLAKE2b-256 |
595a0f72fc49aac304cfadef812742d737f8c0bc544f9911d1c44ae6adc27561
|
File details
Details for the file project_logging-0.1.0-py3-none-any.whl.
File metadata
- Download URL: project_logging-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c4af9fa1bc8e18cd5d3eab5cd17b8ec0e604caec905f77be700f829a0305d7e
|
|
| MD5 |
56a4f5f61c44e2739c00707ddf8d7dd0
|
|
| BLAKE2b-256 |
1fcec56df7f6d7130c0486f90dd607c2b8b53774baab1bc79dfdf1bf365e5e73
|