Skip to main content

Locom

PyPI-Status PyPI-Versions GitHub issues Build Status GitHub license

Locom is the acronym log comments. It is designed to help with log analysis.

If you are a tester or systems analyst, you need to go through the logs frequently. It is very often useful to take notes or highlight some lines. If the log is from complex system, it would be useful share your comments with others. It means commented log should be saved in some common format. This is exactly what this tool is for.

Installation

pip install locom 

How it works

  1. Get log file, which needs to be commented on.

  2. Create rules file, which describe comments and highlights of the rows.

  3. Run locom in command line.

  4. Get html version of the log with comments and highlights.

Example

This example is placed example directory.

Log: input.txt

Brno
Fake row
Prague
Fake row
Bratislava
Fake row
Vienna
Fake row
Warsaw
Fake row
Berlin
Fake row
Paris
Fake row
Stockholm
Fake row
Madrid
Fake row

Rules File: rules.txt

re     Brno          red       red comment
re     Prague        green     green comment
re     Bratislava    blue      blue comment
re     Vienna        yellow    yellow comment
row    9             gray      gray comment
row    11            violet    violet comment
re     Paris         low       low row and comment
re     Stockholm     normal    normal row and comment
re     Madrid        hide

CLI

locom cli -r rules.txt -i input.txt -o output_example.html  --title "Example of rows and comments" --description "This example shows all possible type of rows and comments."

Note: Used Python has to have /Scripts in the path.

Output HTML: output_example.html

html output example

Missing line 17 is not a error. It is result of hide render.

Rules File

One line in file is one rule. Every rules has 3 mandatory parts and 1 optional part. Parts are separated by 4+ whitespaces.

Consider this example with named parts.

re                     Brno                red            red comment
[row recognizer type]  [recognizer value]  [render type]  [comment - optional]

Recognizer

2 types of recognizers are implemented:

  • re - Recognizer value is regular expression for this type of recognizer.

  • row - Recognizer value is row number for this type of recognizer.

Renders

List of all renders:

  • red
  • green
  • blue
  • yellow
  • gray
  • violet
  • low
  • normal
  • hide

Metadata

Release files for locom 0.3.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for locom 0.3.9
File Size Uploaded Provenance
locom-0.3.9.tar.gz 13.0 kB Without provenance Details

Release files / locom-0.3.9.tar.gz

Download URL locom-0.3.9.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4308249bd382800ffc61ffe5d98b2d0f626afa1d7e680622a7370d875444b9e4
BLAKE2b-256 checksum
How to use checksums
091e4e4d0b18fa8de965ed06a783c95540d2105d4b7a3a4bcc0a8b137827ace2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.7

Security for locom 0.3.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page