Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

project_logging-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

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

Hashes for project_logging-0.1.0.tar.gz
Algorithm Hash digest
SHA256 13110f6f92f9a1658ab2fa346cadd1551f053f30fa5a170f1ed73c4bccea5bff
MD5 8712b73e47443a57095f4b8b5c4ecdeb
BLAKE2b-256 595a0f72fc49aac304cfadef812742d737f8c0bc544f9911d1c44ae6adc27561

See more details on using hashes here.

File details

Details for the file project_logging-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for project_logging-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c4af9fa1bc8e18cd5d3eab5cd17b8ec0e604caec905f77be700f829a0305d7e
MD5 56a4f5f61c44e2739c00707ddf8d7dd0
BLAKE2b-256 1fcec56df7f6d7130c0486f90dd607c2b8b53774baab1bc79dfdf1bf365e5e73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page