Skip to main content

Usefull wrapper methods for logging native package

Project description

Travis CI build status (Linux) https://coveralls.io/repos/github/jonDel/loggers/badge.svg?branch=master Documentation Status Code Health https://www.versioneye.com/user/projects/58233ff57a7295003aab5425/badge.svg?style=flat Latest PyPI version

loggers

loggers is a Python library that provides usefull wrapper methods for logging class. To be used as a superclass for your own classes.

Example

>>> from loggers import Loggers
>>>
>>> class spamClass(Loggers):
...   def __init__(self, logFolder=None):
...       super(spamClass, self).__init__('spamClass', logFolderPath=logFolder)
...   def do_stuff(self, arg):
...       if not type(arg) == str:
...         self.log.error("I was expecting a string. :( ")
...       else:
...         self.log.debug("I received my string. :)")
...
>>> spam = spamClass('/tmp/logs/spamClass')
>>> spam.log.error('ERROR')
Log: ERROR | Log level:ERROR | Date:31/10/2016 16:51:47
>>> spam.set_log_rotate_handler(True)
>>> spam.do_stuff(123)
Log: I was expecting a string. :(  | Log level:ERROR | Date:31/10/2016 16:51:47
>>> spam.do_stuff('Eggs')
>>> spam.set_log_level('DEBUG')
Log: Changing log level to DEBUG | Log level:DEBUG | Date:31/10/2016 16:51:47
>>> spam.do_stuff('Spam')
Log: I received my string. :) | Log level:DEBUG | Date:31/10/2016 16:51:47

Installation

To install loggers, simply run:

$ pip install loggers

loggers is compatible with Python 2.6+

Documentation

https://loggers.readthedocs.io

Source Code

Feel free to fork, evaluate and contribute to this project.

Source: https://github.com/jonDel/loggers

License

GPLv3 licensed.

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

loggers-0.1.3.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

loggers-0.1.3-py2.7.egg (6.2 kB view hashes)

Uploaded Source

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