Skip to content

About

A Python CLI tool for parsing and analyzing application logs with validation, pytest tests, and structured reports.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LogLens CLI

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.

Project Status

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.

Supported Log Format

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

Planned CLI Usage

python main.py samples/app.log

Filter by log level:

python main.py samples/app.log --level ERROR

Filter by module:

python main.py samples/app.log --module auth

Generate JSON report:

python main.py samples/app.log --format json

Save report to file:

python main.py samples/app.log --output report.txt

Show malformed lines:

python main.py samples/app.log --show-broken

Project Structure

loglens-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

Testing

The project uses pytest.

Run tests from the project root:

python -m pytest -v

Current test status:

51 passed

Main Goals

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.

Roadmap

v0.1

  • Fixed-format log parser;
  • text and JSON reports;
  • filtering by level and module;
  • malformed line handling;
  • full pytest coverage for core modules.

v0.2

  • time range filtering;
  • CSV export;
  • improved report formatting;
  • extended sample logs.

v0.3

  • support for JSON logs;
  • pluggable parser architecture;
  • chart generation for log statistics.

Future Ideas

  • GUI interface;
  • rule-based anomaly detection;
  • support for multiple log formats;
  • larger test suite and CI integration.

Author

Created by kotysheff as a Python and QA automation portfolio project.

About

A Python CLI tool for parsing and analyzing application logs with validation, pytest tests, and structured reports.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages