Skip to main content

Creates a reasonable logging configuration for a Python project

Project description

readylog

Readylog is a logging configuration template for Python's logging.

Usage

Basic example:

# 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

from readylog import create_dict_confg

print create_dict_config.__doc__

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

readylog-0.5.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

readylog-0.5.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file readylog-0.5.0.tar.gz.

File metadata

  • Download URL: readylog-0.5.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for readylog-0.5.0.tar.gz
Algorithm Hash digest
SHA256 f3e754eddb4f050f948f4869c5f2d1a28a593c92dfa8641367d5d7074e564cdd
MD5 3381e6a7c46f3b91954846dfc298153a
BLAKE2b-256 c7a173c6d509badd8be3ce4694d80253b84a51fc6f28e3021b024d6d088df6c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for readylog-0.5.0.tar.gz:

Publisher: continuous-delivery.yml on fleetingbytes/readylog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file readylog-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: readylog-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for readylog-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c58b910da307a7d80f207415bfa45a0377aa3dcf3510ead8b6ca974227aba48
MD5 abd765ca0a769abbb3e9dfbe5999b2f5
BLAKE2b-256 185228de0710209230d5b5d4c2e36a3402b9a16046eb4cb6079de2efcd40280e

See more details on using hashes here.

Provenance

The following attestation bundles were made for readylog-0.5.0-py3-none-any.whl:

Publisher: continuous-delivery.yml on fleetingbytes/readylog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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