Skip to main content

A generic logging class

Project description

Avologger

built with Python3

A generic logging class for Python

Basic setup and usage are simple. Just import the class and create a Logger instance with a location to save the log file, it will handle everything else!
The log files will even be capped at a configurable limit and rotated after they have reached the limit.

To install (via pip): Next run the install command:

pip install avologger

To install (via source): Download the source files as an archive and extract them on your computer.

Next run the install command:

python setup.py install

Usage (for more detailed example see avologger_sample.py in sample directory):

from avologger import Logger

def main():
    log = Logger("/logs/test.log")

    log.info("This is a test...")
    log.error("We have a problem!")

if __name__ == "__main__":
    main()

Attributes

  • Log File Location
  • Logger Name (Default: Calling script)
  • Max Log File Size {in Megabytes} (Default: 1 MB)
  • Log File Backup Count (Default: 10)
  • Logging Level (Default: INFO)
  • Log Format (Default: %(levelname)s: [%(name)s]: %(asctime)s - %(message)s)
  • Date Format (Default: %m/%d/%Y %H:%M:%S)

All attributes are configurable, and all except log file location have default values.

Additional Features

  • Timing decorator (captures the run time of wrapped functions)
  • Logs any uncaught exeptions with the addition of 1 line to your code

Logging Levels

  • DEBUG
  • INFO
  • WARNING
  • ERROR
  • CRITICAL
  • EXCEPTION

Log File Sample Output

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

avologger-1.0.4.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

avologger-1.0.4-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file avologger-1.0.4.tar.gz.

File metadata

  • Download URL: avologger-1.0.4.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for avologger-1.0.4.tar.gz
Algorithm Hash digest
SHA256 b5030d5ea3acc2b6e2a663dff7293923649a815585ea5386778309cafdd3ce7d
MD5 26edf0c40c04061f03597eb037256b23
BLAKE2b-256 d09504ef29067a475c4d99c0b554e26aa8f4214bc8c672652072ef7b41f64c54

See more details on using hashes here.

File details

Details for the file avologger-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: avologger-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for avologger-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 64d131395055a619c630a8ca7d77badc90d4680c772f05235aeafdf24cf05324
MD5 a076ac0889982084a8857a49547458cf
BLAKE2b-256 35dfebc901797e43681b3818a5135111f2fad4d1ed9b6ed7f3dd4e4cab1262fe

See more details on using hashes here.

Supported by

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