EazyLogger
A simple module to add color to Python log messages.
Table of Contents
Installation
Binary installer is available at the Python Package Index (PyPi).
pip install eazylogger
Logger
Logger(name, msg_fmt="[%(levelname)s] - %(message)s (%(name)s)", info_fmt="%(message)s")
Logger class with color-coded log messages.
Parameters
-
name : str
- String expression representing the name of the logger class.
-
msg_fmt : str, default [%(levelname)s] - %(message)s (%(name)s)
- String expression representing how the debug, warning, error, and critical log messages are formatted. Defaults to "[%(levelname)s] - %(message)s (%(name)s)".
-
info_fmt : str, default %(message)s
- String expression representing how the info and success messages are formatted. Defaults to "%(message)s".
Examples
Basic Example
-
Import and instantiate
Loggerclass:# main.py from eazylogger import Logger logger = Logger(__name__)
-
Logging methods:
# main.py logger.debug("Example debug message") logger.info("Example info message") logger.warn("Example warning message") logger.error("Example error message") logger.critical("Example critical message") logger.success("Example success message")
Using Parameters
-
name:logger = Logger("customName") logger.debug("Example debug message with customName")
[DEBUG] - Example debug message with customName (customName)
-
msg_fmt:-
Sets the message format for
logger.debug,logger.warn,logger.error, andlogger.critical. -
For full list of keyword arguments see the docs
logger = Logger( __name__, msg_fmt="%(asctime)s %(message)s [%(pathname)s]", ) logger.debug("Example debug message with custom msg_fmt")
2000-01-01 12:00:00,000 Example debug message with custom msg_fmt [~\main.py]
-
-
info_fmt- Sets the message format for
logger.infoandlogger.success.
logger = Logger( __name__, info_fmt="[%(levelname)s] - %(message)s (%(name)s)", ) logger.info("Example info message with custom info_fmt")
[INFO] - Example info message with custom info_fmt (__main__)
- Sets the message format for
Metadata
Release files for eazylogger 24.9.27
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| eazylogger-24.9.27.tar.gz | 3.3 kB | Without provenance | Details for eazylogger-24.9.27.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eazylogger-24.9.27-py3-none-any.whl | Python 3 | none | any | Details for eazylogger-24.9.27-py3-none-any.whl |
Total release size: 7.1 kB
Release files / eazylogger-24.9.27.tar.gz
| Download URL | eazylogger-24.9.27.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8cf9dc40be86b881086e4bc81fee3d933540da5e9ea3f33d991108eb0c8a7db7
|
|
BLAKE2b-256 checksum How to use checksums |
4cd142b0a43cd7fe065770c27c07cb9bca2f8e582fc702bacffd03935b6d22f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.0
|
Release files / eazylogger-24.9.27-py3-none-any.whl
| Download URL | eazylogger-24.9.27-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9cc4dd444f4cbbdc5eb8de94848f8c2f108e27b2f395bb4e0b2be82c60b30ad7
|
|
BLAKE2b-256 checksum How to use checksums |
5918bfbabffd20581b01124f3caaffac06b5ebfea397e70aafe939066d898139
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.0
|
Security for eazylogger 24.9.27
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.