semvec/pypi-packages huggingface dataset:
TCLog 0.1.2
A tiny Rich-based logger with aligned prefixes.
Requires Python: >=3.9

# 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

```bash
pip install TCLog
````

## Quick Start

```python
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

```python
log.custom(
    "cache warm",
    label="CACHE",
    label_color="[cyan]",
    message_color="[white]"
)
```

## Prompt Input

```python
name = log.prompt("Enter name: ")
```

## Spinner

```python
spin = log.Spinner(log, label="WORKING", label_color="[magenta]")
spin.start()

# do work...

spin.stop()
log.success("done")
```

## Alignment Control

```python
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