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

Add ability to add custom log level and custom log level label #146

Open
chadglaser4682 opened this issue Sep 11, 2024 · 0 comments
Open

Comments

@chadglaser4682
Copy link

I read the doc, but may have missed it. Feel free to point it out if this is already available.

My team is implementing go-hclog in a service, while other services of our services are using slog.
In our slog implementation, we added a level for auditing, in between warn and error. We had the ability to change the name of the level so it outputs the word "audid" where it would normally say "debug" or "info" etc.

We added the audit ability to the go-hclog implementation at log level 6, but I can't seem to get the logger to output the name "audit" I can get the logger to output [?????] or if I turn on json, it outouts @Level:all

slog's level.go explains that it leaves gaps in the level integers, (-4, 0, 4, 8) and we added a log level between 4 and 8. Then we change the name in a function in our own code. But in go-hclog, I can't seem to change the level label, it seems to be added in intlogger.go -> writer.go.

tldr: Custom log level and custom log level labels.

@chadglaser4682 chadglaser4682 changed the title Add ability to add custom log level Add ability to add custom log level and custom log level label Sep 11, 2024
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

No branches or pull requests

1 participant