Library for logging facility
Project description
Overview
It is an utility library which allow you to use a common interface accross all its component to log messages with different levels.
Logging levels
It use the standard logging levels widely used on all systems:
# | Levels |
---|---|
0 | EMERGENCY |
1 | ALERT |
2 | CRITICAL |
3 | ERROR |
4 | WARNING |
5 | NOTICE |
6 | INFO |
7 | DEBUG |
Installation
TODO
Logging components
Type | Status | Description |
---|---|---|
CLILogger | Available | It outputs logging messsages to STDOUT |
FileLogger | Planned | It will outputs logging messages directly to file |
CLI Logger
This logging components allow you to outputs logging information and raises and exception from critical level and above.
Usage
# Import the dependency
from clagiordano.python3_logger.CLILogger import CLILogger
# Init the component
logger = CLILogger()
# Use it to log something
logger.info("Sample info message")
logger.error("Sample error message")
logger.critical("Sample critical message")
Ad default it uses ANSI colors but you can toggle the ansi flag but you can easily toggle off this feature using the following code:
logger.set_ansi(False)
Sample ANSI output (default)
Sample ANSI OFF output
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the releases on this repository.
Authors
- Claudio Giordano - Initial work - clagiordano
See also the list of contributors who participated in this project.
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
Hashes for clagiordano.python3-logger-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 665b0f506405eb1a7bc4fa756e8a8a6fecc97c0e7bd9d150d71c3f8f1e22ee37 |
|
MD5 | 21aec7bc999724df26bc58a535872093 |
|
BLAKE2b-256 | e613b0ae80b534b6d1b6fdc098e291fdf76431a093ce2c9c674e3298e46f7668 |
Hashes for clagiordano.python3_logger-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6cdfd1138ae0615650cf3059cbe079cb90352d8cf37cf2889061bf07b0d750b |
|
MD5 | 199bb79df2bf409178c1898437d4baeb |
|
BLAKE2b-256 | 6aea27a5c77a4fd20ef29e74bb4e19975d97d316cd8105a21220f82630590c77 |