Skip to main content

A tiny Rich-based logger with aligned prefixes.

Project description

tklog

A minimal, Rich-powered logger with aligned prefixes, custom labels, and a lightweight spinner.

Designed for clean CLI output without the complexity of full logging frameworks.

Installation

pip install TCLog

Quick Start

from tklog import Logger

log = Logger("App")

log.info("starting")
log.success("connected")
log.warning("slow response")
log.error("failed request")
[ App           - 12:41:08 - INFO     ] > starting
[ App           - 12:41:08 - SUCCESS  ] > connected
[ App           - 12:41:08 - WARNING  ] > slow response
[ App           - 12:41:08 - ERROR    ] > failed request

Custom Labels

log.custom(
    "cache warm",
    label="CACHE",
    label_color="[cyan]",
    message_color="[white]"
)

Prompt Input

name = log.prompt("Enter name: ")

Spinner

spin = log.Spinner(log, label="WORKING", label_color="[magenta]")
spin.start()

# do work...

spin.stop()
log.success("done")

Alignment Control

log = Logger(
    "Backend",
    name_width=12,
    level_width=8
)

All messages remain visually aligned regardless of label length.

Requirements

  • Python 3.9+
  • rich >= 13

License

MIT

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

tclog-0.1.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

tclog-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file tclog-0.1.1.tar.gz.

File metadata

  • Download URL: tclog-0.1.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for tclog-0.1.1.tar.gz
Algorithm Hash digest
SHA256 598dd02d209eb537035dc3514a04205bec35c71f99ac93b52b8df68e238a571d
MD5 5b1e3b10661afe0ac0a22870ea2a45b1
BLAKE2b-256 829d91fd63a466e33a3414c3144488f426b171ccbad4a2ccec96e1fdeabfe35b

See more details on using hashes here.

File details

Details for the file tclog-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tclog-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for tclog-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 30a0395988b81354e2d55ab56a61630a2353a0cdcbeb9cf1bc2931bfccf123b5
MD5 a692d1c378111be767bbc79a3758c40e
BLAKE2b-256 d2f63139ad3782932ad0a8607cdd403df2852c98b75f8f5d694a6162243d1a28

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