Skip to main content

A simple high level logger wrapper to log into console/file with different level.

Project description

PyPI version Build Status Coverage Status

Plogger

Plogger - a simple high level logger wrapper to log into console/file with different level. Used built-in logger module.

Installation

For most users, the recommended method to install is via pip:

pip install plogger

Import and usage

from plogger import logger

log = logger('NAME')
log.info('Test message')
import plogger

log = plogger.logger('NAME')
log.info('Log it as INFO')

Result

2020-01-08 02:03:47 | INFO | NAME | Log it as INFO

Usage

  • As standalone logger function:
import plogger

logger = plogger.logger('NAME', level=10)

logger.info('Test message')
logger.error('Test message')
logger.warning('Test message')
logger.debug('Test message')
2022-03-28 21:04:39 | INFO    | NAME         5 | Test message
2022-03-28 21:04:39 | ERROR   | NAME         6 | Test message
2022-03-28 21:04:39 | WARNING | NAME         7 | Test message
2022-03-28 21:06:36 | DEBUG   | NAME         8 | Test message

Changelog

1.0.6 (16.04.2022)
  • Enable/disable logging fixed
1.0.5.post0 (4.04.2022)
  • minor changes in log entry format
1.0.5 (4.04.2022)
  • Console log will be colorized.
  • use_color=True param added
  • Line number added to the log
1.0.4 (28.03.2022)
  • added log level selection with the "level" param
  • log level entry aligned
1.0.3 (29.01.2022)

Fixed entries duplicating. Added handlers cleaning

1.0.2 (25.01.2022)

console_output=sys.stderr by default

1.0.1 (10.01.2022)

Added console_output=sys.stdout param

1.0.0 (26.01.2020)

Added logger() function

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

plogger-1.0.6.tar.gz (4.8 kB view hashes)

Uploaded source

Built Distribution

plogger-1.0.6-py3-none-any.whl (4.9 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page