Metadata-Version: 2.4
Name: tailr
Version: 1.0.1
Summary: Colorized live log viewer for the terminal. Zero dependencies.
Author: dsk-dev-ai
License: MIT
Project-URL: Homepage, https://github.com/dsk-dev-ai/tailr
Project-URL: Source, https://github.com/dsk-dev-ai/tailr
Project-URL: Issues, https://github.com/dsk-dev-ai/tailr/issues
Project-URL: Funding, https://github.com/sponsors/dsk-dev-ai
Keywords: log,tail,color,terminal,cli,devtools,tui
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Logging
Classifier: Topic :: Terminals
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

<div align="center">

# 🎨 tailr

**Colorized live log viewer for your terminal.**

Tail files or piped stdin with automatic log-level and keyword highlighting.
Zero dependencies. Works in Python 3.8+.

[![PyPI](https://img.shields.io/pypi/v/tailr?color=blue&logo=pypi&logoColor=white)](https://pypi.org/project/tailr/)
[![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)](#)
[![License](https://img.shields.io/badge/license-MIT-green)](#)
[![Docker](https://img.shields.io/badge/docker-ghcr.io%2Fdsk--dev--ai%2Ftailr-blue?logo=docker)](https://github.com/dsk-dev-ai/tailr/pkgs/container/tailr)

</div>

---

## Why tailr?

Logs are noisy. `tailr` makes them *readable* at a glance:

- **Level highlighting** — `INFO`, `WARN`, `ERROR`, `FATAL`, `DEBUG`, `TRACE` get distinct colors.
- **Keyword highlighting** — `error`, `failed`, `exception`, `traceback`, `panic` pop in bright red.
- **Timestamp coloring** — dates and times are dimmed so the signal stands out.
- **Live follow** — watch logs grow in real time, just like `tail -f`.
- **Filter on the fly** — regex grep, or filter by log level.
- **Zero dependencies** — pure Python stdlib. No install drama, no bloat.

## Install

```bash
pip install tailr
```

Or run without installing:

```bash
pipx run tailr --help
```

Via Docker:

```bash
docker run --rm ghcr.io/dsk-dev-ai/tailr --help
```

## Usage

```bash
# Colorize a log file (last 10 lines)
tailr app.log

# Follow a growing log live
tailr -f app.log

# Follow with more history
tailr -f -n 200 app.log

# Filter by log level
tailr -l ERROR app.log

# Grep with a regex, live
tailr -f -g "kafka|redis" app.log

# Pipe anything in
docker logs -f app | tailr
kubectl logs -f pod | tailr
journalctl -f | tailr -l WARN
```

### Options

| Flag | Description |
|------|-------------|
| `-f, --follow` | Keep tailing appended lines (like `tail -f`) |
| `-n, --lines N` | Show N lines from the end (default 10) |
| `-g, --grep REGEX` | Only show lines matching a regex |
| `-l, --level LVL` | Only show lines with this level (`ERROR`, `WARN`, …) |
| `--version` | Print version |

### Colors

```
INFO      -> blue
DEBUG     -> gray
WARN      -> orange
ERROR     -> red
FATAL     -> magenta
TRACE     -> gray
keywords  -> bright red + bold
timestamps-> dim
```

Set `NO_COLOR=1` to disable colorization, or `FORCE_COLOR=1` to force it.

## How it works

`tailr` streams lines and applies a lightweight ANSI colorizer powered by a few
small regexes — no external parsing libs, no heuristics beyond the log shape.
It respects `isatty()` to avoid spewing escape codes into pipelines.

## Tests

```bash
python -m pytest
```

Tested on Python 3.8–3.12 via GitHub Actions.

## Sponsor

Enjoy `tailr`? Keep it free and dependency-free by [becoming a sponsor](https://github.com/sponsors/dsk-dev-ai) on GitHub 💜.

---

<div align="center">

**tailr** · Colorized logs you can actually read.

</div>
