Felog is yet another simple logging library to quickly and simply deploy logging with projects.
Project description
felog
Description
Felog is yet another simple logging library to quickly and simply deploy logging with projects. The aim with this library is to have a simple to import and uniform logging system across several projects. Felog allows such and even gives the option to enable/disable debug mode which allows for more verbose debugging.
Dependencies
Felog only has one dependency: logging
Installation
pip install felog
Usage
Setup a Logger
import felog.core as felog
log = felog.log(<project or module name>)
Log Levels
There are several log levels and you can switch between them at any time, including debug mode. The levels are as follows:
- Debug
- Info
- Warning
- Error
- Critical
To switch between these levels, you can simply call the function to facilitate as follows:
import felog.core as felog
log = felog.log(<project or module name>)
log.setLevel(<level name>)
Send an INFO Log
import felog.core as felog
log = felog.log("TEST123")
log.info("THIS IS WHATEVER INFO YOU WANT TO LOG.")
Send a WARNING Log
import felog.core as felog
log = felog.log("TEST123")
log.warning("THIS IS WHATEVER INFO YOU WANT TO LOG.")
Send an ERROR Log
import felog.core as felog
log = felog.log("TEST123")
log.error("THIS IS WHATEVER INFO YOU WANT TO LOG.")
Send a CRTICAL Log
import felog.core as felog
log = felog.log("TEST123")
log.critical("THIS IS WHATEVER INFO YOU WANT TO LOG.")
Setting up and using DEBUG MODE
You can setup DEBUG MODE in one of two ways:
import felog.core as felog
log = felog.log(<project or module name>,debug=True)
OR
import felog.core as felog
log = felog.log(<project or module name>)
log.setLevel("debug")
From this point forward, the logger will display debug messages as well as all others. To Debug you would simply send debug logs as follows:
import felog.core as felog
log = felog.log("TEST123",debug=True)
log.debug("THIS IS WHATEVER INFO YOU WANT TO LOG.")
To disable DEBUG MODE, you would simply set the log level back to INFO as follows:
import felog.core as felog
log = felog.log("TEST123",debug=True)
log.debug("THIS IS WHATEVER INFO YOU WANT TO LOG.")
log.setLevel("info")
log.info("THIS IS OTHER INFO YOU WANT TO LOG.")
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
File details
Details for the file Felog-1.0.1.tar.gz.
File metadata
- Download URL: Felog-1.0.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5885263bf4c00f02d4671aa2a5d8f377d8e8efaea9af0bba2a886c753fe3e1f
|
|
| MD5 |
ce3e98b2f9cfd88b82bd29829ded66c7
|
|
| BLAKE2b-256 |
f3bce7a473b5da74ef6d3df21d9d590aaded77f546dc3a765f3a7ff281c56eda
|