A tiny Python logger with colorful ANSI terminal output.
Project description
tinycolorlog
A tiny, zero-dependency Python logger with colorful ANSI terminal output.
Installation
pip install tinycolorlog
Usage
from tinycolorlog import logger
logger.info("Server started on port 8080")
logger.success("Database connection established")
logger.error("Failed to read configuration file")
All text โ both the [TAG] and the message โ is printed in bold italic with full color.
Unicode Font Styles
Pass font= to convert your output into a Unicode font style. This works anywhere Unicode is rendered: terminals, Slack, Discord, GitHub, Notion, etc.
logger.error("Failed to read configuration file", font="monospace")
logger.success("All systems operational", font="bold_italic")
logger.info("Deploying to production", font="double_struck")
Available Fonts
| Font name | Preview |
|---|---|
bold |
๐ฏ๐ผ๐น๐ฑ ๐๐ฒ๐ ๐ |
italic |
๐ช๐ต๐ข๐ญ๐ช๐ค ๐ต๐ฆ๐น๐ต |
bold_italic |
๐๐ค๐ก๐ ๐๐ฉ๐๐ก๐๐ ๐ฉ๐๐ญ๐ฉ |
monospace |
๐๐๐๐๐๐๐๐๐ ๐๐๐ก๐ |
double_struck |
๐๐ ๐ฆ๐๐๐ ๐ค๐ฅ๐ฃ๐ฆ๐๐ |
script |
๐๐ธ๐๐พ๐ ๐ ๐๐๐๐ |
fraktur |
๐ฃ๐ฏ๐๐จ๐ฑ๐ฒ๐ฏ ๐ฑ๐ข๐ต๐ฑ |
Output
Each method prints bold + italic colored text with a tag prefix:
| Method | Color | Tag |
|---|---|---|
logger.info() |
๐ต Blue | [INFO] |
logger.success() |
๐ข Green | [SUCCESS] |
logger.error() |
๐ด Red | [ERROR] |
API Reference
logger.info(message, font=None)
Prints an informational message in blue.
logger.success(message, font=None)
Prints a success message in green.
logger.error(message, font=None)
Prints an error message in red.
Parameters:
message(str) โ The text to display.font(str, optional) โ A Unicode font style name. See table above. RaisesValueErrorfor unknown font names.
Advanced: Custom Instance
You can also instantiate TinyLogger directly, or use the font converter on its own:
from tinycolorlog.handler import TinyLogger, _convert_font
my_logger = TinyLogger()
my_logger.success("Custom logger works!", font="script")
# Convert text independently
print(_convert_font("hello world", "fraktur"))
# โ ๐ฅ๐ข๐ฉ๐ฉ๐ฌ ๐ด๐ฌ๐ฏ๐ฉ๐ก
License
MIT โ see LICENSE for details.
Project details
Release history Release notifications | RSS feed
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 tinycolorlog-0.2.0.tar.gz.
File metadata
- Download URL: tinycolorlog-0.2.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a78cb36562eb4f9e9e61b3785d84c8e97ee6047c0471b022af27d6d1037698d2
|
|
| MD5 |
e30ef260a6cb739ce7255bd1cd1d9e4c
|
|
| BLAKE2b-256 |
d72faa5590be3780f76d79f5c66a19c0431ebb0820ecb9ef4eeec72c923dbb6c
|
File details
Details for the file tinycolorlog-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tinycolorlog-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd9c905c9277b6681849e579882335943e55f480809e16586366b740436e113c
|
|
| MD5 |
d205b5c0746bd6283dcf7d3cdbdec8ce
|
|
| BLAKE2b-256 |
5dd95041408e6ab5f8d223047fe8cd5f502b6037ed5a377219d8bfe27cfbd4ee
|