BNMetrics / logme
- четверг, 27 сентября 2018 г. в 00:16:56
Python
Python Logging For Humans (Configurable color logging to the terminal in v1.2.*!)
Logme is a Python package that makes logging simple and robust. If you have found logging in Python not so straight forward, download this package and give it a try! :)
logme package now supports color and styling output in the terminal!
The colors and style is customizable in logme.ini
, here is a screenshot of how it looks like in the terminal:
To use color output in logme, make sure your logme package and logme.ini
is up-to-date.
Check the configuration details here.
If you have a function you want to log, you can do this in your python file:
import logme
@logme.log
def my_awesome_function(my_arg, logger=None):
logger.info('this is my log message')
"""rest of the function"""
You can do the same with classes too:
import logme
@logme.log
class MyAwesomeClass:
def my_function(self, my_arg):
self.logger.info('this is my log message')
pretty nice right? :)
To get started, head to the quickstart page.
$ pipenv install logme ✨🍰✨
You can find the documentation at https://logme.readthedocs.io/en/latest/ . Give it a try!