LogLens CLI is a Python command-line tool for parsing and analyzing application log files.
The project is focused on clean Python architecture, structured data models, predictable error handling, and automated testing with pytest.
Current version: v0.1
Status: in development
Implemented:
- core data models;
- model validation;
- custom validation error;
- automated tests for models.
Planned for v0.1:
- log line parser;
- file reader;
- log analyzer;
- text and JSON report formatter;
- output writer;
- CLI interface;
- pytest test coverage for all core modules.
LogLens v0.1 supports the following fixed log format:
YYYY-MM-DD HH:MM:SS | LEVEL | module | message
Example:
2026-06-11 14:32:10 | ERROR | auth | User login failed
Supported log levels:
DEBUG, INFO, WARNING, ERROR, CRITICAL
python main.py samples/app.logFilter by log level:
python main.py samples/app.log --level ERRORFilter by module:
python main.py samples/app.log --module authGenerate JSON report:
python main.py samples/app.log --format jsonSave report to file:
python main.py samples/app.log --output report.txtShow malformed lines:
python main.py samples/app.log --show-brokenloglens-cli/
├── docs/
│ ├── check_lists.md
│ ├── LogLens CLI v0.1 Project Brief.pdf
│ └── QA Notes - LogLens CLI v0.1.pdf
├── loglens/
│ ├── __init__.py
│ ├── exceptions.py
│ ├── main.py
│ └── models.py
├── tests/
│ └── test_models.py
├── README.md
└── .gitignore
The project uses pytest.
Run tests from the project root:
python -m pytest -vCurrent test status:
51 passed
This project is built as a portfolio-level Python/QA automation project.
It demonstrates:
- Python data modeling;
- validation logic;
- custom exceptions;
- log parsing;
- file processing;
- CLI design;
- automated testing with pytest;
- checklist-based test design;
- clean separation of responsibilities.
- Fixed-format log parser;
- text and JSON reports;
- filtering by level and module;
- malformed line handling;
- full pytest coverage for core modules.
- time range filtering;
- CSV export;
- improved report formatting;
- extended sample logs.
- support for JSON logs;
- pluggable parser architecture;
- chart generation for log statistics.
- GUI interface;
- rule-based anomaly detection;
- support for multiple log formats;
- larger test suite and CI integration.
Created by kotysheff as a Python and QA automation portfolio project.