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.1.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.1.tar.gz.
File metadata
- Download URL: project_logging-0.1.1.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 |
f00018511f85d98656d464e76c9106a98b26a00a73d1de2d8fc56f47da69e092
|
|
| MD5 |
5e0ab8b9c709bf7d4948d0c61258aec1
|
|
| BLAKE2b-256 |
d790f9addab6b70778b3df701fa5223c537c4b60f3765aebd3a9a1645e039cf4
|
File details
Details for the file project_logging-0.1.1-py3-none-any.whl.
File metadata
- Download URL: project_logging-0.1.1-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 |
164cd57f49f5c6376236815f65e366855ca7e4ad2963cd8b5d6cced53d4683e8
|
|
| MD5 |
0e7550313ff3aeb59a86aaaf1aaeb504
|
|
| BLAKE2b-256 |
aa946fbdcc32dd435517f3001c0b976774e457e7cf93b3acb979343b2932c3e8
|