Skip to main content

LogScope — Beautiful log viewer for the terminal

Project description

LogScope Logo

LogScope

Beautiful, simple, and powerful log viewer for the terminal.

Python Typer Rich License

A modern CLI tool that turns boring text logs or messy JSON lines into stunning, structured, and colorful terminal outputs—complete with a live dashboard, smart highlighting, and HTML exporting.


Features that shine

  • Fast & Lightweight: Tail files natively or stream huge data directly via pipes (cat server.log | logscope).
  • Colored & Structured Logs: Automatically identifies INFO, WARNING, ERROR, CRITICAL, and DEBUG, applying beautiful typography.
  • Universal Parser: Reads typical bracket logs ([INFO]) and parses modern NDJSON / JSON logs out of the box (e.g., Kubernetes, Docker).
  • Auto-Highlighting: Magically highlights IPs, URLs, Dates/Timestamps, UUIDs, and E-Mails with dynamic colors.
  • Custom Keyword Highlighting: Highlight specific keywords in log messages with --highlight and customize colors with --highlight-color.
  • Live Dashboard: Watch logs stream in real-time alongside a live statistics panel keeping track of Error vs Info counts (--dashboard).
  • HTML Export: Loved your console output so much you want to share it? Export the beautiful log structure directly to an HTML file to share with your team! (--export-html results.html)
  • Filtering: Filter by one or more levels (--level ERROR or --level ERROR,WARN,INFO). Search by substring (--search) or regular expression (--regex / -e), with optional case-sensitive matching and invert match (--invert-match / -v, grep-style) to hide matching lines.
  • Themes: Choose from 6 beautiful themes (default, neon, ocean, forest, minimal, spectra) or create custom themes via config file.
  • Plain output: Use --no-color when you need unstyled text (e.g. piping to other tools or logs without ANSI codes).
  • Gzip logs: Read .gz files directly—LogScope opens them as text without a manual zcat pipe.

Installation

Ensure you have Python 3.9+ and pip installed.

# Clone the repository
git clone https://github.com/vinnytherobot/logscope.git
cd logscope

# Install via Poetry
poetry install
poetry run logscope --help

# Or install globally via pip
pip install -e .

Usage & Examples

Using a File

# Basic colorized look
logscope /var/log/syslog

# Tailing a log in real-time (like tail -f)
logscope backend.log --follow

# Filter only errors
logscope production.log --level ERROR

# Multiple levels (comma-separated)
logscope production.log --level ERROR,WARN,INFO

# Search text dynamically
logscope server.log --search "Connection Timeout"

# Regex search (requires --search)
logscope server.log --search "timeout|refused|ECONNRESET" --regex

# Hide lines that match a pattern
logscope noisy.log --search "healthcheck" --invert-match

# Case-sensitive search
logscope app.log --search "UserID" --case-sensitive

# Highlight specific keywords
logscope server.log --highlight "timeout" --highlight-color "bold red"

# No colors (plain terminal output)
logscope app.log --no-color

# Compressed log file
logscope archive/app.log.gz

Piping from other commands (Stdin support)

LogScope acts as a brilliant text reformatter for other tools!

kubectl logs my-pod -f | logscope
docker logs api-gateway | logscope --level CRITICAL
cat nginx.log | grep -v GET | logscope --dashboard

The Live Dashboard Mode

Monitor your logs like a pro with a live dashboard tracking error occurrences.

logscope app.log --dashboard --follow

Exporting to HTML

Need to attach the logs to a Jira ticket or Slack message but want to keep the formatting?

logscope failed_job.log --export-html bug_report.html

Themes

Choose from 6 beautiful themes: default, neon, ocean, forest, minimal, spectra.

logscope app.log --theme neon

Create a .logscoperc file to set your preferred theme:

{
  "theme": "neon",
  "custom_themes": {
    "my-theme": {
      "levels": {
        "ERROR": ("✖", "bold red")
      }
    }
  }
}

Stack

  • Rich -> UI Layouts, Colors, Highlighters, HTML Export.
  • Typer -> Modern, fast, and robust CLI creation.
  • typing-extensions -> Typed CLI annotations on Python 3.9.
  • Pathlib / Sys / gzip -> File and standard input streaming; gzip text logs.

Contributing

Open an issue or submit a pull request! Tests are written using pytest.

# Running tests
pytest tests/

License

MIT License.

Made by vinnytherobot

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

logscope_cli-0.4.6.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

logscope_cli-0.4.6-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file logscope_cli-0.4.6.tar.gz.

File metadata

  • Download URL: logscope_cli-0.4.6.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for logscope_cli-0.4.6.tar.gz
Algorithm Hash digest
SHA256 4015c4306e970f05547299318d73cb0dac50e8abdc4772b11f1b0a5a05792d98
MD5 0a8d621496d26e395bd630ce39a8df62
BLAKE2b-256 8bf21da19e5eca104c8eaf9b7d2aa1a62e251451dd2088d75f2a7d6ae5146eb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for logscope_cli-0.4.6.tar.gz:

Publisher: publish.yml on vinnytherobot/logscope-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file logscope_cli-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: logscope_cli-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for logscope_cli-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2a8ed703e85c9f12225317d125e4c405259b4bc9ab7dc6b91e66d22197c74b70
MD5 bee56ac681cf09de01a960088ad9c582
BLAKE2b-256 2a0a0f66fbac94732f2a8d68f1b4f961d6e45181da8e53bb0c31608ea3b606aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for logscope_cli-0.4.6-py3-none-any.whl:

Publisher: publish.yml on vinnytherobot/logscope-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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