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.2.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.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tclog-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 e1289c988e7a2ec6dc42d989b79c72ef3615a614294ad005190ac8f7247deee6
MD5 e49dba85da878ae5e50975d97e160c9e
BLAKE2b-256 a78780f8ce3cec0192ac96d03ebc99dc2c80a90a47e0cc71a13b4cc8e2682b75

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tclog-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 39a2d0caa1a5e903a7970c288b473c589c6afa07e1ef9a53d745507ff344e8e1
MD5 bfbb14a237f30009bd3f708d8e6d727c
BLAKE2b-256 1181eecfac5290df45c47fc3e59bd6a185e7a7fd21e4e8f7408ca6da8a8710c5

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