Skip to main content

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. Raises ValueError for 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinycolorlog-0.2.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tinycolorlog-0.2.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

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

Hashes for tinycolorlog-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a78cb36562eb4f9e9e61b3785d84c8e97ee6047c0471b022af27d6d1037698d2
MD5 e30ef260a6cb739ce7255bd1cd1d9e4c
BLAKE2b-256 d72faa5590be3780f76d79f5c66a19c0431ebb0820ecb9ef4eeec72c923dbb6c

See more details on using hashes here.

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

Hashes for tinycolorlog-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd9c905c9277b6681849e579882335943e55f480809e16586366b740436e113c
MD5 d205b5c0746bd6283dcf7d3cdbdec8ce
BLAKE2b-256 5dd95041408e6ab5f8d223047fe8cd5f502b6037ed5a377219d8bfe27cfbd4ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page