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 details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

Details for the file KLogLib-0.2.0.tar.gz.

File metadata

  • Download URL: KLogLib-0.2.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for KLogLib-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c24c9962e18d0fdab106853e9015c40eb46d5103c67bc9ba36f7d1a164548d96
MD5 f072f37a294a18875a5a1f2d83674788
BLAKE2b-256 602edc51fa66258ae39b94dec212567fca1e5dd1724c4c9574aefa2a0ff00f3f

See more details on using hashes here.

File details

Details for the file KLogLib-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: KLogLib-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for KLogLib-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff840ebded8cff7df20bea4d362c4df26f2d6f57bf72000785c65018993a16bf
MD5 b728092e1ecf77b6e4470a1bf3664367
BLAKE2b-256 73ff9ed6f08806ff5900c1151b7de20e4a821c9044d77527e795d4f532f88fc9

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