No project description provided
Project description
\n
Just Logger
This is a library featuring a simple logger for Python 3.
Features
- Add Log by Type ✔️
- Save Log's to file ✔️
- Filter Log's by Type ✔️
- Configure by .env ✔️
Using
Here's how you can use this library to log events. First, let's understand the options for Levels and Filters.
Levels
class LogLevel(Enum):
INFO = "INFO"
WARNING = "WARNING"
ERROR = "ERROR"
CRITICAL = "CRITICAL"
Filters
class LogFilter(Enum):
ONLY_INFO = [LogLevel.INFO]
ONLY_WARNING = [LogLevel.WARNING]
ONLY_ERROR = [LogLevel.ERROR]
ONLY_CRITICAL = [LogLevel.CRITICAL]
DEBUG = [LogLevel.INFO, LogLevel.WARNING, LogLevel.ERROR, LogLevel.CRITICAL]
PROD = [LogLevel.WARNING, LogLevel.ERROR]
Creating a Log
To create a log, first you must instantiate a Logger class. Then, create logs at the key points in your code.
from just_logger import logging as jl
logger = jl.Logger(log_file="logs/log.log")
logger.info("This is an info message")
# | 2024-02-26T08:43:06.094567 - INFO: This is an info message |
This example demonstrates how to use the library to log an informational message.
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python-just-logger-1.1.1.tar.gz.
File metadata
- Download URL: python-just-logger-1.1.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c884590db23192d0fa205b1692d784dfe636b84e7c33cacbb551ed5e1ee85c8
|
|
| MD5 |
2035d052b9cacd41e38077c055d77460
|
|
| BLAKE2b-256 |
b1a72cb5c5c957e14600c2e7aae541dd447ecec2fa578311110e3a2cb5181417
|
File details
Details for the file python_just_logger-1.1.1-py3-none-any.whl.
File metadata
- Download URL: python_just_logger-1.1.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc2c8b4c15ce9e28044a241f1ba04f8e1892fa83b666356aedfa513da959b53c
|
|
| MD5 |
111edd3d2902aab925995385c9acc2b5
|
|
| BLAKE2b-256 |
d3c6880bc5f5e3b6e85f1c529a7ac0cb2005464dc773b0ee6375ef1d9b74c585
|