Skip to content

cakoose/python-log-file-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python log file reader

Scenario:

  1. Some other program is periodically appending lines to a log file.
  2. Your program runs every few minutes and needs to process any new log lines added since the last run.

If it's just a single log file that keeps growing, use log_file_reader.read(...).

If it's a log file that is rotated (e.g. by logrotate), use log_file_reader.read_rotated(...).

Using it

This is not published to PyPI yet. Just take "log_file_reader.py" and use it.

Developing

Make sure you have Poetry installed.

  1. Make sure dependencies are installed: poetry install
  2. Activate local environment: poetry shell
  3. Run tests: pytest --cov=. --cov-branch --cov-report html log_file_reader_test.py
    • Coverage report is generated to "htmlcov/index.html".

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages