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.
Release files for friendlylog 1.0.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 | |
|---|---|---|---|
| friendlylog-1.0.2.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| friendlylog-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.3 kB
Release files / friendlylog-1.0.2.tar.gz
| Download URL | friendlylog-1.0.2.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0dac3b29eb8c239c3023ceaf40656d20189d656149956e4b03630203a7b691a0
|
|
BLAKE2b-256 checksum How to use checksums |
7d9c2bb26e81d26da5226a40a7993af30e1ce0fe3ca432c3fa24e352ef3bb4ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / friendlylog-1.0.2-py3-none-any.whl
| Download URL | friendlylog-1.0.2-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef013660d1b0f021681d9745c2e4223ae8956794ed92ef643727405bd4e11ba8
|
|
BLAKE2b-256 checksum How to use checksums |
cec4672baae9d30bd8330448ed823ce747ab739dcbf7844ecccb3ca05fb0f1be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|