Python logging for humans: colorful, clean interface, straightforward usage, simply friendly log.
Project description
FriendlyLog: Python logging made simple
FriendlyLog is a simple, colorful, user-friendly, thread-safe logger for Python
(2
and 3
).
Install
pip install friendlylog
Usage
- Simple Logger
import logging
from friendlylog import simple_logger as log
# Anything above or including DEBUG will be logged.
log.setLevel(logging.DEBUG)
log.debug("debug message")
log.info("info message")
log.warning("warning message")
log.error("error message")
log.critical("critical message")
Will result in the following logs (test.py
is the name of the file):
[07-Oct-19 11:06:06.107 in test.py - <module>: 3] DEBUG: debug message
[07-Oct-19 11:06:06.107 in test.py - <module>: 4] INFO: info message
[07-Oct-19 11:06:06.107 in test.py - <module>: 5] WARNING: warning message
[07-Oct-19 11:06:06.107 in test.py - <module>: 6] ERROR: error message
[07-Oct-19 11:06:06.107 in test.py - <module>: 7] CRITICAL: critical message
- Colored Logger
import logging
from friendlylog import colored_logger as log
# Anything above or including DEBUG will be logged.
log.setLevel(logging.DEBUG)
log.debug("debug message")
log.info("info message")
log.warning("warning message")
log.error("error message")
log.critical("critical message")
Will result in the following logs (test.py
is the name of the file):
Contributing
- Write the code for a new logger under
friendlylog
. It should export the following methods:setLevel(level)
debug(msg: string)
info(msg: string)
warning(msg: string)
error(msg: string)
critical(msg: string)
- Write unit tests with
>92%
coverage undertests
. You can run the tests locally using this command:bash run_tests.sh
. Make sure the new logger is thread-safe. Also, add a unit test that checks thread-safety; - Submit a pull-request with your changes.
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
friendlylog-1.0.2.tar.gz
(3.9 kB
view details)
Built Distribution
File details
Details for the file friendlylog-1.0.2.tar.gz
.
File metadata
- Download URL: friendlylog-1.0.2.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dac3b29eb8c239c3023ceaf40656d20189d656149956e4b03630203a7b691a0 |
|
MD5 | 154aba48ac1db67a0e7db0d40c534171 |
|
BLAKE2b-256 | 7d9c2bb26e81d26da5226a40a7993af30e1ce0fe3ca432c3fa24e352ef3bb4ed |
File details
Details for the file friendlylog-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: friendlylog-1.0.2-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef013660d1b0f021681d9745c2e4223ae8956794ed92ef643727405bd4e11ba8 |
|
MD5 | e68368a7ba0965f126dff50b182a1fde |
|
BLAKE2b-256 | cec4672baae9d30bd8330448ed823ce747ab739dcbf7844ecccb3ca05fb0f1be |