-
Notifications
You must be signed in to change notification settings - Fork 94
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
logger callbacks #284
logger callbacks #284
Conversation
5eb674d
to
70fc41c
Compare
312bb98
to
945a88c
Compare
1435009
to
1136fb4
Compare
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.
LGTM after the small changes I requested (if you agree).
@rafaeldtinoco thanks for reviewing this.
Returing to this soon. |
1136fb4
to
093e05c
Compare
093e05c
to
e30e0bc
Compare
Despite having passed all the tests, I need to define the callbacks on them to make them silent. |
f038b84
to
024fa7d
Compare
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.
LGTM
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.
Could you please give an example of how this is used with different settings and what they entail? Because i'm not sure how this looks work out in the end.
I had to look at the equivalent tracee PR to understand the first setting, and I have no idea how the filtering would work, maybe tests could help here.
024fa7d
to
761bb03
Compare
@geyslan minor nits and then we merge. LGTM. Please link the issue to the comment (about making the log filter function generic). BTW, make sure to address comment from @NDStrahilevitz about the regex compilation first. |
7e07666
to
405e95b
Compare
After merging this and aquasecurity/tracee#2663, I'll open an issue in both projects to tackle the hard-coded filters move. |
loggerCallback() calls callbacks, log() and []logFnFilters(), which can be set by the libbpfgo consumer via SetLoggerCbs(). This moves output filtering from C libbpf_print_fn() to Go filterOutput() which can be set as one of the slice of filter funcs. This also introduces LogWarnLevel, LogInfoLevel and LogDebugLevel constants.
405e95b
to
c2933e2
Compare
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.
LGTM
Feel free to undraft tracee's change and move on there. Thanks! |
commit 761bb03
commit 56803f4
Fixes: #276
Fixes: #6
Fixes: #55
Fixex: aquasecurity/tracee#2417
Related fix during the work:
Tests
Changing one filter callback for tests purpose only (== instead of !=):
Context