-
Notifications
You must be signed in to change notification settings - Fork 41
🔊 Improve Logging: move to slog and add trace level #276
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
5e98f60
Add Warn and Trace loglevels
david-garcia-garcia 6bc731e
Move to slog
david-garcia-garcia 256a452
fixes
david-garcia-garcia 6c90533
missing test file
david-garcia-garcia 79dbc66
Fix tests
david-garcia-garcia 36b69ce
Add wrapper with trace
david-garcia-garcia 1bcd163
Merge remote-tracking branch 'upstream/main' into logging
david-garcia-garcia c3212b4
fix
david-garcia-garcia e5d1e51
fix lint
david-garcia-garcia 681d7da
LINT
david-garcia-garcia 38b1429
LINT
david-garcia-garcia 30ec55d
Merge branch 'main' of https://github.com/maxlerebourg/crowdsec-bounc…
maxlerebourg 20d7c3f
:bento: Use only 4 level of logs
maxlerebourg 9ca1e90
Merge branch 'main' into logging
maxlerebourg 3b6cd01
Merge remote-tracking branch 'origin' into logging
maxlerebourg 4126d74
fix after merge
maxlerebourg 406a8fa
:bento: fix lint
maxlerebourg db250dc
:bento: fix lint + remove trace logger from tests
maxlerebourg 982f2ba
:bento: fix tests
maxlerebourg 648302b
:bento: fix lint
maxlerebourg b2a1658
:bento: try to fix test
maxlerebourg e7d5917
:bento: Fix tests
maxlerebourg 01e3435
:bento: fix README + adjust logs
maxlerebourg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you are using the loglevel with "bouncer.log.LOGLEVEL",
Above for Trace, you are using bouncer.log.Log(context, logger.LEVEL)
Is it possible to have it written the same way ?
What's the difference except adding the "context"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes... I did not like that either. The thing is that slog only has convenience methods for the out of the box log levels. I solved that by adding a wrapper so log calls are now consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, with the wrapper, code looks more readable