Simple wrapper around the python logging module
Project description
eglogging
Super-simple wrapper around python's logging library
To use it, import everything: from eglogging import *
You can then log a message m
using these functions,
in order of increasing importance:
DEBUG(m), INFO(m), MSG(m), WARN(m), ERROR(m), CRITICAL(m)
Note that MSG(m)
is actually exactly the same as INFO(m)
; it's provided for backwards-compatibility.
By default, configuration is loaded from logger_config_DEFAULT.json
,
where the output will be formatted to
logfmt.
To load another configuration, just call logging_load_config_from_file(fn)
,
where fn
is the path to a json file containing a valid configuration.
A human-friendly configuration is provided in logger_config_HUMAN.json
.
In this config, WARNINGs and higher-level messages will be colored by default.
You can also set the color of any message manually by providing a color argument:
INFO("Arya's got this. See how I overwrote the default color?",
color = LOG_COLORS['GREEN'])
The available colors are BLACK
, RED
, GREEN
, YELLOW
, BLUE
, MAGENTA
, CYAN
, WHITE
, BLACK_BG
, RED_BG
, GREEN_BG
, YELLOW_BG
, BLUE_BG
, MAGENTA_BG
, CYAN_BG
, and WHITE_BG
.
For more info on how to set up a custom formatter / configuration, look here.
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
Built Distribution
File details
Details for the file eglogging-1.1.0.tar.gz
.
File metadata
- Download URL: eglogging-1.1.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50f7a8aec5c56f7a8760044e4fe286aa2bf762245bd444a9103a1c4f6ddbfc1b |
|
MD5 | 8605cf09bbcd9fa2f6e09ab1da367d49 |
|
BLAKE2b-256 | 89a5cb476e41dc64421a43f18c4a91c1ea828ad80ae8df796aed1e1c1baaa39b |
File details
Details for the file eglogging-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: eglogging-1.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dccee3268bbcacee6058742201fc19e89eb366158107dfa34a6bbf9909ac1719 |
|
MD5 | 636ba256a5695c785f70e5acef9f02eb |
|
BLAKE2b-256 | 8f1a04fc0fff15dae4aaa148bca2a62c041b7dee776e69853cf425927b289775 |