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.1.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.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

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

Hashes for project_logging-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f00018511f85d98656d464e76c9106a98b26a00a73d1de2d8fc56f47da69e092
MD5 5e0ab8b9c709bf7d4948d0c61258aec1
BLAKE2b-256 d790f9addab6b70778b3df701fa5223c537c4b60f3765aebd3a9a1645e039cf4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for project_logging-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 164cd57f49f5c6376236815f65e366855ca7e4ad2963cd8b5d6cced53d4683e8
MD5 0e7550313ff3aeb59a86aaaf1aaeb504
BLAKE2b-256 aa946fbdcc32dd435517f3001c0b976774e457e7cf93b3acb979343b2932c3e8

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