Vistor's Console Logger (VCLog) offers a minimal and colorful console logging. Single-script. No dependencies.
Project description
VCLog: Minimal and Simple Console Logging
Vistor's Console Logger (VCLog) offers a minimal and colorful console logging. Single-script. No dependencies.
Features
As every logger in the world, there are four levels of logging: info
, debug
, warning
, and error
.
from vclog import Logger
Logger.info("info")
>> |I| info
Logger.debug("debug")
>> |D| debug
Logger.warning("warning")
>> |W| warning
Logger.error("error")
>> |E| error
It also has a plain
method in which color, background color, and style can be specified.
Logger.plain("plain text with format", color="blue", bg_color="green", style="bold")
The logger can also be disabled by setting the disable
attribute to True
. This only works for the instantiated logger.
logger = Logger("instance", disable=True)
logger.info("this message will not be displayed")
The package also offers a format
method to get the formatted string directly.
from vclog import format
message: str = format("Hello, World!", color="red")
The main feature of VCLog is that the Logger
can be used as a static class or it can be instantiated. When instantiated, you can provide a name to be displayed.
Logger.info("as a static method")
>> |I| as a static method
logger = Logger("instance")
logger.info("as an instance")
>> |I| [instance] as an instance
Installation
Follow the next steps for installing the simulation on your device.
Requierements:
- Python 3.10.0 or higher
Note: VCLog works on Linux, Windows and Mac.
Install from pip
VCLog is available as a pip package. For installing it just use:
pip install vclog
Install from source
You can either clone the repository
git clone https://github.com/vistormu/vclog.git
or just copy and paste the logger.py
file.
Documentation
The official documentation of the package is available on Read the Docs. Here you will find the installation instructions, the API reference and some minimal working examples.
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
File details
Details for the file vclog-1.1.1.tar.gz
.
File metadata
- Download URL: vclog-1.1.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2d44ae893cdea29a6d442fd556ca5b8f51f161e18ea1fbbc9fad953c81fa596 |
|
MD5 | a024f93c3c3baa531b242d0cb8055f6f |
|
BLAKE2b-256 | b00a91d26b9630319b34e22e084239fe60593a33246de925cc7eea20c1d62ecd |
File details
Details for the file vclog-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: vclog-1.1.1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e27e59ec931358dcad3079c160a2a2adde0c1f6fd5d354534889511ebdb41893 |
|
MD5 | 65fe028948aa6e7204dbcaefa39b02df |
|
BLAKE2b-256 | 898fb180363f2d52fb68d822bbcb6355fdbd98a7c02731a1c8cb1b63806050da |