Skip to main content

No project description provided

Project description

KLog

KLog is a library which aims to bring easy logging in Python

Releases PyPI Releases


Installation

pip install KLogLib

Features

  • Create Log folder/file
  • Specify max log size (MB)
  • Zip and save 'N' last log files

Usage

First of all, we have to import the library

from KLog.KLog import KLog

Once we have imported it, we have to initialize the library

def init_log():
  logModel = KLog.__new__(KLog)

  logModel.__init__(folder='Logs/', log_name='log.log', max_size=50, is_zip=True, max_zip=10)
  • folder: Path where the log file will be created.
  • log_name: Name of the log file to be created.
  • max_size: Maximum size of log files (MB)
  • is_zip: Allow to create .zip files to save a backup of the log files.
  • max_zip: Maximum .zip files.

The only thing left is to use the library

logModel.write(where='MainApplication', msg='Let`s logging', severity=KLog.LogSeverity.DEBUG)
  • where: Method from where we are writing the log line.
  • msg: Message that we want to be written in the log file.
  • severity: Log line type, can be one of those:
    • Warning
    • Warning
    • Warning
    • Warning
    • Warning

Example of deleting zips

https://user-images.githubusercontent.com/17411934/231798446-a4187172-878c-423a-9abd-1cf40e6c58bb.mov

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

KLogLib-0.2.0.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

KLogLib-0.2.0-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

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