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

Custom log level names with color #61

Open
nasdf opened this issue Apr 22, 2024 · 2 comments
Open

Custom log level names with color #61

nasdf opened this issue Apr 22, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@nasdf
Copy link

nasdf commented Apr 22, 2024

It'd be great to be able to customize the log level names and keep the colors.

I think simple package level variables would work for most use cases.

var (
  InfoLevelName  = "INF"
  ErrorLevelName = "ERR"
)

Happy to submit a PR if you agree with the feature.

@lmittmann
Copy link
Owner

This is a popular request. You can currently customize levels via the ReplaceAttr option. But I agree that it is not very handy, since you need to manage colors on your own. I am not sure how the API could look like yet, but modifying global variables is not the way.

@iamsumit
Copy link

Raised a PR to provide this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants