Skip to main content

snakewatch v1.0.0 A log watcher

Project description

h1. A log watcher written in Python

Allows RegEx-based line matching for various actions.

Configs are JSON files of the following format:

bc. [
{
"regex": "<pattern>",
"action": "<action>"[,
"<argument>": "<value>"[, ...]
]
}[, ...]
]

Currently supported ConsoleUI actions:

* *Print* (with colours!) - prints the line to stdout
** additional arguments: _fore_, _back_, and _style_ (see "colorama":https://pypi.python.org/pypi/colorama for a list of supported values)

* *Ignore* - ignores the input line

* *Write* - write the line to a file. Multiple actions can write to the same file (_truncate_ must be the same).
** additional arguments: _truncate_

*Required action arguments:*
* regex - the regular expression to match against
* action - the action to perform if the regex matches a line from the input

*Optional action arguments:*
* continue - if set to true, matching will continue even if the action is called (default is false)

h2. Example config for monitoring SASS output:

bc. [
{
"regex": "^>>>.*",
"action": "Print",
"fore": "GRAY"
},
{
"regex": "^\\s+error.*",
"action": "Print",
"fore": "WHITE",
"back": "RED"
},
{
"regex": ".*",
"action": "Print",
"fore": "YELLOW",
"style": "DIM"
}
]


h3. Credits

"*colorama*":https://pypi.python.org/pypi/colorama - Terminal output colours

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snakewatch-1.0.0.tar.gz (26.5 kB view details)

Uploaded Source

File details

Details for the file snakewatch-1.0.0.tar.gz.

File metadata

  • Download URL: snakewatch-1.0.0.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for snakewatch-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ab4d735daa95872cdc8294fbdd1410f37f6cbffe2e92891c97847a72b3028f17
MD5 726abf0ce16d096e31fd5e138c0e8ea9
BLAKE2b-256 ff1cd43219865f61c6ae6c8158ffaadb9bbf5a75d40cd65f290effe9dc01b0da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page