A minimal logger for a minimal experience
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 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.