UNPKG

loglens-cli

Version:

A powerfull cli tool to analyze and filter log files smartly

82 lines (53 loc) โ€ข 1.97 kB
````markdown # ๐Ÿ” loglens-cli **loglens-cli** is a powerful CLI tool designed for developers and DevOps engineers to quickly filter, inspect, and analyze log files. Whether you're debugging an issue or summarizing errors across days of logs, `loglens-cli` helps you extract just what you need โ€” fast. --- ## โœจ Features - ๐Ÿ”Ž Filter logs by log level (`error`, `warn`, `info`, `debug`) - โฑ๏ธ Filter logs between specific date/time ranges - ๐ŸŽจ Colorized output for better readability - ๐Ÿ“ Supports line-by-line JSON logs and fallback for raw logs - ๐Ÿ’ก Easy-to-use CLI with helpful options --- ## ๐Ÿ“ฆ Installation ```bash npm install -g loglens-cli ```` --- ## ๐Ÿš€ Usage ```bash loglens --file ./your-log-file.log [options] ``` ### ๐Ÿ“Œ Options | Option | Alias | Description | | --------- | ----- | ----------------------------------------------------- | | `--file` | `-f` | Path to your log file (required) | | `--level` | `-l` | Filter by log level: `error`, `warn`, `info`, `debug` | | `--from` | | Start timestamp (ISO format): `"2025-07-27T10:00:00"` | | `--to` | | End timestamp (ISO format) | --- ### โœ… Example Commands ```bash loglens -f logs/app.log loglens -f logs/app.log -l error loglens -f logs/app.log --from "2025-07-27T00:00:00" --to "2025-07-28T00:00:00" ``` --- ## ๐Ÿงช Sample Log Format ```json {"timestamp":"2025-07-29T10:45:30","level":"info","message":"User logged in"} {"timestamp":"2025-07-29T10:46:00","level":"error","message":"Failed to connect to DB"} ``` --- ## ๐Ÿ› ๏ธ Development Clone this repo and run locally: ```bash git clone https://github.com/ansh-2004/loglens-cli.git cd loglens npm link ``` Now you can run `loglens-cli` globally during development. --- ## ๐Ÿ“„ License MIT License ````