-
Notifications
You must be signed in to change notification settings - Fork 286
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
Update VerifierLogLevel
to use bitflags
#376
Conversation
✅ Deploy Preview for aya-rs-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
aya/src/bpf.rs
Outdated
/// Used to disable all logging. | ||
const DISABLE = 0; | ||
/// Logs tracing with details level 1 | ||
const LEVEL1 = 1; |
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.
I think this should be DEBUG
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.
Oops sorry I forgot to review this last week!
See comments - I still think that LEVEL1 and LEVEL2 are bad names (as you discovered, LEVEL2 implies LEVEL1 anyway). I think we should use DEBUG
and VERBOSE
.
aya/src/bpf.rs
Outdated
/// Logs tracing with details level 1 | ||
const LEVEL1 = 1; | ||
/// Log tracing with details level 2 | ||
const LEVEL2 = 2 | Self::LEVEL1.bits; |
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.
I think this should be VERBOSE
agreed! those are better names |
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.
Perfect, thank you!
aya/src/bpf.rs
Outdated
const DEBUG = 1; | ||
/// Enables verbose verifier logging. | ||
const VERBOSE = 2 | Self::DEBUG.bits; | ||
/// Enables verifier stats |
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.
Missing period at the end of the sentence
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.
@conectado oops just noticed this - could you fix it pls?
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.
sorry didn't see this message, right away
As talked with @alessandrod here, using
bitflags!
to implement theVerifierLogLevel
.I think that using the
Default
trait might be better than having aDEFAULT
value in the struct but not so sure on that.Also setting
Level2
asLevel1 | 2
since in the kernel level 1 seems to imply level 2. Meaning, that when they check for log level they either check forBPF_LOG_LEVEL2
(when it's exclusive to 2) orBPF_LOG_LEVEL
when it also include level 1, So I didn't think being able to use 2 was very useful.