Skip to main content

A generic logging class

Project description

Generic Logger

built with Python2

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: Download the source files as an archive and extract them on your computer.

Next run the install command:

python setup.py install

Usage:

from logger import Logger

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

    log.info("This is a test...")
    log.warning("I know what you did last summer...")

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: 3)
  • 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.

Logging Levels

  • DEBUG
  • INFO
  • WARNING
  • ERROR
  • CRITICAL

Log File Output Example

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

rm_logger-0.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

rm_logger-0.0.1-py2-none-any.whl (4.5 kB view details)

Uploaded Python 2

File details

Details for the file rm_logger-0.0.1.tar.gz.

File metadata

  • Download URL: rm_logger-0.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.1 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15

File hashes

Hashes for rm_logger-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a6f25e6a386e0c272931f18ca45dbe5ed1834ba0489fb3b77d4ab505d8a1bce8
MD5 486dd3d973f5defc18114d532c21b0f6
BLAKE2b-256 2f45c63690003602fa7552225a9c7cfa0f6249a2538ea97e905bfa0455437997

See more details on using hashes here.

File details

Details for the file rm_logger-0.0.1-py2-none-any.whl.

File metadata

  • Download URL: rm_logger-0.0.1-py2-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.1 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15

File hashes

Hashes for rm_logger-0.0.1-py2-none-any.whl
Algorithm Hash digest
SHA256 fef345a4ac8f280ea33e08e7a9f8bbd9cb6c535901aa2abaa4cbb38bfb9d17c7
MD5 838731cc83636efb2140d2f713519fd8
BLAKE2b-256 453576eadcade28f4952fd5182130ae36b95e0adb4f82d6f49a5f29474521a7a

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