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

Request: Support custom log levels #107

Open
almostSouji opened this issue Oct 9, 2024 · 3 comments
Open

Request: Support custom log levels #107

almostSouji opened this issue Oct 9, 2024 · 3 comments

Comments

@almostSouji
Copy link

(Potentially I'm just blind and this already exists)

[level_map] in the config is not able to achieve this (if i'm not missing something):
DEV = "BLUE" displays as BLUE
i'd want an option to print the DEV level/severity as DEV but highlighted in blue

if this is available in some of the formatting magic i'd appreciate some guidance, yet still this might be worth considering as part of the config file

@bomgar
Copy link
Member

bomgar commented Oct 10, 2024

at the moment this is not a feature.

This is the relevant handlebar helper:

handlebars_helper!(level_style: |level: str| {

Maybe we need one that takes additional parameters 🤔

@bomgar
Copy link
Member

bomgar commented Oct 10, 2024

Could you provide a few example log lines and a short explanation how they should be rendered?

@almostSouji
Copy link
Author

almostSouji commented Oct 12, 2024

{"timestamp":"2024-10-11T22:54:43.113Z","level":"ABC","message":"log of the level abc"}
{"timestamp":"2024-10-11T22:54:43.113Z","level":"DEF","message":"log of the level def"}
{"timestamp":"2024-10-11T22:54:43.113Z","level":"DEF","message":"another def log"}
[log_levels]
abc = "cyan"
def = "yellow"

image

if i understand the readme correctly, currently only these are rendered in distinct colors:

trace
debug
info
warn
error
fatal

and everything else ("XYZ" in the readme example shows that) defaults to magenta?
i'd like to customize that color

my real use case is that i have data frames for different packet types i'd like to distinctly color; doing it via the level seems like the more generally useful approach in the context of this project (though i am aware i am somewhat abusing the semantics of "level" to fit that use case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants