Skip to main content

A really simple logger configurator for Python 3.

Project description

Woodder

A really simple python logger configurator. It does two things:

  • Formats your logs according to: %(asctime)s - %(name)s - %(filename)s - %(levelname)s - %(message)s
  • Creates a logs directory, where it puts all the logs for each run of the application.

Usage

Here's how you use it:

# In a file named: sample_logging.py
import logging
TODO: put wooder import


if __name__ == '__main__':
    project_name = "my_project"
    log_dir = "my_logs"
    Woodder.configure_logging(project_name, log_dir=log_dir)

    logger = logging.getLogger("my-logger")

    logger.info("some info")
    logger.debug("some debug")
    logger.warning("some debug")
    logger.critical("some critical")
    logger.error("some error")

Output:

2021-02-02 23:23:33,878 - my-logger - sample_logging.py - INFO - some info
2021-02-02 23:23:33,878 - my-logger - sample_logging.py - DEBUG - some debug
2021-02-02 23:23:33,878 - my-logger - sample_logging.py - WARNING - some debug
2021-02-02 23:23:33,879 - my-logger - sample_logging.py - CRITICAL - some critical
2021-02-02 23:23:33,879 - my-logger - sample_logging.py - ERROR - some error

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

woodder-1.0.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

woodder-1.0.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file woodder-1.0.0.tar.gz.

File metadata

  • Download URL: woodder-1.0.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for woodder-1.0.0.tar.gz
Algorithm Hash digest
SHA256 11e336d6e68da5fcee52242aa5b55df62afa0f2b4696eb690e262a2635c00990
MD5 f61a4795540432b2485cfd0813e0e00c
BLAKE2b-256 875256cd97381e45fe56def1f39fee3f9976225ae1c473becdd24d7d83e8766f

See more details on using hashes here.

File details

Details for the file woodder-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: woodder-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for woodder-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a023274466928168a7b12b814ba14156d75bbaca123871c10196f21548638a9
MD5 f185610e309c9a1be0a17e8fbfe37ad8
BLAKE2b-256 89e76015d79bc5152cc580fcba7ffd9689c2c105c974806ce3e89abe505cbf47

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