Logme - Python Logging for Humans
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! :)
V1.3.0 Updates
logme.ini file now supports custome datefmt and style! Thanks to @afunTW suggestion! :)
Here is an example of how you can specify these parameters in your logme.ini configuration:
[my_config]
level = DEBUG
formatter =
fmt: {asctime} - {name} - {levelname} - {message}
datefmt: %Y/%m/%d
style: {
stream =
type: StreamHandler
active: True
level: DEBUG
file =
type: FileHandler
active: True
level: DEBUG
formatter: {name} :: {funcName} :: {levelname} :: {message}
filename: mylogpath/foo.log
Note: Only top level master_formatter supports parameters as shown above, individual handler formatter will not.
Terminal Color Output
logme 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 if you are using a version before 1.2.0.
Check the configuration details here.
In A Nutshell
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.
Installation
$ pipenv install logme ✨🍰✨
Documentation
You can find the documentation at https://logme.readthedocs.io/en/latest/ . Give it a try!
Metadata
Release files for logme 1.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| logme-1.3.2.tar.gz | 13.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| logme-1.3.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 32.1 kB
Release files / logme-1.3.2.tar.gz
| Download URL | logme-1.3.2.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c1f0a7f72750669fba500920aadcd10a665c3bc176425c0de97cdd7b5b19e65f
|
|
BLAKE2b-256 checksum How to use checksums |
56a17c8935decdb08e58dabe38e40e4e1c1f9b61d2b1fcaa20df12c384127fdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
|
Release files / logme-1.3.2-py2.py3-none-any.whl
| Download URL | logme-1.3.2-py2.py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
320006cf6c7898ca76698b48f9a40fb172bdafd713a1c942baaa70efcb6c7338
|
|
BLAKE2b-256 checksum How to use checksums |
feecf9564ec9c7583c5cbaee5b385c85d1c72119b62ef37bc47f816f6f92af38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
|