Skip to content

Filter entries by level and pattern - #2

Merged
autoantohaki merged 2 commits into
feat/followfrom
feat/filters
Oct 21, 2026
Merged

autoantohaki merged 2 commits into
feat/followfrom
feat/filters

Conversation

@autoantohaki

Copy link
Copy Markdown
Member

Before: every line of a log was printed, so finding the errors in a busy service meant piping through grep and losing level colors and stack traces along the way.

After: relay-logs -l warn app.log shows only warnings and worse, -g keeps lines matching a pattern, and -x drops lines matching one. They work with -f, so relay-logs -f -l error -x /health api.log follows only the errors that matter. Indented lines such as stack frames stay with the entry above them, so an error keeps its trace even though the frames have no level of their own.

Patterns are regular expressions and ignore case unless they contain an uppercase letter.

How: createFilter builds a predicate from the options and remembers, per source, whether the last entry was shown so continuation lines follow it. Invalid patterns and unknown level names are reported as usage errors with exit code 2.

This branch is stacked on #1; please merge that first.

@autoantohaki
autoantohaki merged commit e5bca0e into feat/follow Oct 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant