Custom library for logging with colors, including execution date-time information and executable line (optional). Librería personalizada para logging con colores, con informacion de fecha - hora de ejecución y linea ejecutable (opcional)
Project description
LogsColor
Logscolor is a lightweight and easy-to-use open-source library for creating logs with customizable colors in Python. Ideal for developers looking to simplify tracking and debugging in their projects.
- Colored log messages.
- Different log levels (
INFO,WARNING,ERROR,TRACE). - Optional: Display the line of code where the message was generated.
Installation
To install logscolor, simply run the following command:
pip install logscolor
Then, in your project, import the logging functions:
from logscolor.logscl import info, error, trace, warning, infoL, errorL, traceL, warningL
With this, you'll be able to use the different logging levels in your code.
Basic Usage
from logscolor.logscl import info, warning, error, trace
info("Information message")
warning("Warning message")
error("Error message")
trace("Debug message")
If you want to include information about the line where the message was generated, use the functions with the L suffix:
from logscolor import infoL
infoL("Information with line number")
Features
- Customizable colors: Each log level has a unique color for easier visual identification.
- Enriched format: Displays the date, time, and optionally the line of origin.
- Lightweight and easy to integrate: Ideal for both large and small projects.
- Support for advanced levels: Includes traceability (trace) for detailed debugging.
- Easy integration: Designed to be a quick and simple replacement for print().
Supported Log Levels
logscolor supports the following log levels, each with custom colors for better visibility:
| Level | Description | Variants |
|---|---|---|
| INFO | Informational messages. | info, infoL |
| WARNING | Warnings about potential issues. | warning, warningL |
| ERROR | Critical error messages. | error, errorL |
| TRACE | Detailed debugging messages. | trace, traceL |
Images
Real Examples
Requirements
- Python 3.7 or higher
- colorama
License
This project is licensed under the MIT License. See the LICENSE file for details.
PyPI
https://pypi.org/project/logscolor/
Contact
Created by Pablo Vega Castro. If you have any questions or suggestions, feel free to contact me at pablovegac.93@gmail.com.
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 logscolor-1.5.tar.gz.
File metadata
- Download URL: logscolor-1.5.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3bca3f10534d0516e76f128190cdf78a62ac0e5a5e7b471e6f1f468c2dc630a
|
|
| MD5 |
f86f65641cf3bc0b8024e0240dbd220c
|
|
| BLAKE2b-256 |
0a2ba541a3aa531512d177b3affce8800c2182b5af949bb205e5d3ae9b1ac7c4
|
File details
Details for the file logscolor-1.5-py3-none-any.whl.
File metadata
- Download URL: logscolor-1.5-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6eda84f603cd5a6aea2d177f2e04f49e4b1562b12fd2c5453dadd06ea66de72b
|
|
| MD5 |
c0d1161fbc03264935c67e179474af8c
|
|
| BLAKE2b-256 |
aa22d0f477d1dc99916adb49b2239c637450176b205d0920d4b0c51cf1a60b0e
|