Skip to main content

A simple Logging generalizer

Project description

#LE Logging Library

This library defines a standardized logging pattern for all Python based Projects inside LE Environment.

It's based on Pythons integrated Logging System and makes it easy to use without redefining Layouts and Rotations manually for every project.

It's mandatory to generalize Logs to simplify debugging and problem solving.

Available Log Levels are defined as ENUM

class Level(Enum):
    DEBUG = 10
    INFO = 20
    WARNING = 30
    ERROR = 40
    CRITICAL = 50

The usage of the Library is simple:

Defining a Rotating LogFile based on filesize:

attribut is the maximum file size in Megabytes [Default is 32MB]
max_backup attribut defines the maximum stored Files before overwriting existing Files [Default is 14 Files]
# Defining loglevel as integer:
from le_logging import RotatingLog

log = RotatingLog(name="Testlog", max_backups=5, max_size=64, level=10)
# Defining LogLevel based on Enum
from le_logging import RotatingLog, Level

log = RotatingLog(name="Testlog", max_backups=5, max_size=64, level=Level.DEBUG)

Defining a Timed Rotating LogFile based on filesize:

# Defining loglevel as integer:
from le_logging import TimedRotatingLog

log = TimedRotatingLog(name="Testlog", max_backups=5, max_size=64, level=10)
# Defining LogLevel based on Enum
from le_logging import TimedRotatingLog, Level

log = TimedRotatingLog(name="TimedTestlog", max_backups=5, timer=1, level=Level.DEBUG)

Using defined LogFiles

log.debug("This is a DEBUG message")
log.info("This is an INFO message")
log.warn("This is a warn message")
log.error("This is an ERROR message")
log.critical("This is a CRITICAL message")

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

le_logging-0.1.0.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.

le_logging-0.1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file le_logging-0.1.0.tar.gz.

File metadata

  • Download URL: le_logging-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for le_logging-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d14da3f0268bbaad625b224152ec8dcbf8f4d0b422f9898aeee3562508529ffe
MD5 3d6838c0ec9a8141d70ce6fbc69b424c
BLAKE2b-256 01313b637e898e61cbbc33036175bbbdfa5fa375aa1750d42bed78e5e58612ee

See more details on using hashes here.

File details

Details for the file le_logging-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: le_logging-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for le_logging-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57e1e83ab07e27b3459a8e1421d1b0d4604d9a36703e69adc657b896909982bf
MD5 c9efb827c4ba3cddba57baccd9022436
BLAKE2b-256 2fb27b0a460b64d56c9de4a87835b083c33bec290a4b9574d9536fea5598138c

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