A simple high level logger wrapper to log into console/file with different level.
Project description
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
from plogger import Logger
Usage
- As standalone logger:
from plogger import Logger
logger = Logger('test', console=True, file=True) # Log into file too
logger().info('log this')
logger.logger.info('and log this too')
- As part of class using inheritance:
from plogger import Logger
class MyClass(Logger):
def __init__(self, logger_enabled=True, *args, **kwargs):
super().__init__(name=self.__class__.__name__, enabled=logger_enabled, *args, **kwargs)
def method_name(self):
self.logger.info('method_name invoked')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
plogger-0.0.1a0.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for plogger-0.0.1a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 794ca5b93fd5c48e0e173b56274cb084975c179adc4e955794d37186900b9954 |
|
MD5 | c98695e518c04c7d16c3f00a05f1933d |
|
BLAKE2b-256 | 6f62d203a0ec7dbaf8854fcdeaad7dcc4ea0c1a3bd64ec46a2d199c9c054e0b6 |