Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This commit adds a lexer for linux kernel logs as outputted by dmesg #1310

Merged
merged 4 commits into from
Dec 9, 2019

Conversation

birkenfeld
Copy link
Member

It supports output from dmesg, in that case it highlights based on
keywords in the line

It can also highlight dmesg -x output. In that case it uses the
loglevels from the kernel to highlight the lines.

Ported from https://bitbucket.org/birkenfeld/pygments-main/pull-requests/815

Copy link
Collaborator

@Anteru Anteru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine, but I'd like to know why warn uses a different regex.

],
'warn': [
include('base'),
(r'.+', Generic.Strong, '#pop')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this not use \n at the end like the other categories?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like an oversight...

@birkenfeld birkenfeld closed this Dec 9, 2019
@birkenfeld birkenfeld reopened this Dec 9, 2019
birkenfeld and others added 4 commits December 9, 2019 12:32
It supports output from `dmesg`, in that case it highlights based on
keywords in the line

It can also highlight `dmesg -x` output. In that case it uses the
loglevels from the kernel to highlight the lines.
* move to textfmts.py where other logfiles are
* fix detection of dmesg -x (heuristic "unknown" state must be last)
* change styles for debug/warn lines
@birkenfeld birkenfeld merged commit c63083d into master Dec 9, 2019
@birkenfeld birkenfeld deleted the 815/MartijnBraam/dmesg branch December 9, 2019 11:43
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.

None yet

2 participants