Metadata-Version: 2.5
Name: logcatx
Version: 0.0.1
Summary: Local web dashboard for offline embedded dual-core log analysis
Project-URL: Homepage, https://github.com/Junbo-Zheng/logcatx
Project-URL: Issues, https://github.com/Junbo-Zheng/logcatx/issues
Author-email: Junbo Zheng <3273070@qq.com>
License: Apache-2.0
License-File: LICENSE
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Requires-Dist: fastapi>=0.110
Requires-Dist: uvicorn>=0.29
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: httpx>=0.27; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Description-Content-Type: text/markdown

# logcatx

[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)

Local web dashboard for offline embedded dual-core log analysis. Feed it one
log file, get an interactive browser dashboard. Deterministic analysis only —
no LLM, no external log-mining dependency, no database, single-process,
in-memory session.

## Install & run

```bash
pip install logcatx
logcatx path/to/logfile.log          # parses, serves, opens browser
logcatx file.log --port 9000         # explicit port
logcatx file.log --no-browser        # headless start
```

The line format is fixed for v1:
`[MM/DD HH:MM:SS] [tid] [LEVEL] [core] [module] message`. Lines that do not
match are kept and shown as unparsed — never dropped.

## Views

1. **Overview** — file info, level pie, top modules, top error templates.
2. **Templates** — searchable/sortable mined-template table; click a row to
   drill into its raw lines.
3. **Timeline** — bucketed stacked bars by level (or by top error templates),
   zoomable; drag-brush a range to jump to Raw Logs in that window; burst
   list marks templates whose count jumps beyond 5σ (leave-one-out).
4. **Raw Logs** — filter by level/core/module/keyword/template/time range,
   paged; click any line to expand ±5 lines of context (unparsed neighbors
   included).

A demo log ships at `src/logcatx/static/synth-demo.log` (16k synthetic lines
with an injected error storm).

## Manual verification checklist

- `logcatx src/logcatx/static/synth-demo.log` — Overview numbers match
  (16601 total, 600 ERROR).
- Templates: search `stat wrong` finds the storm template (300 hits); row
  click filters Raw Logs to it.
- Timeline: ERROR spike at 09:20 visible; brush it → Raw Logs scoped to
  that minute.
- Raw Logs: scroll 16k lines stays smooth (200/page paging); click a line →
  context block opens.
- Port fallback: start a second instance with the same `--port`; it binds
  port+1 automatically instead of failing.

## Development

```bash
pip install -e '.[dev]'
pytest -q                                  # unit + e2e suite
ruff check src tests main.py               # lint
python tools/gen_large.py 1000000 /tmp/big.log   # perf fixture
```

Performance: 1,000,000 synthetic lines parse+mine in ~29s (single core).

## License

Apache-2.0 — see [LICENSE](LICENSE).
