-
Notifications
You must be signed in to change notification settings - Fork 48
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 support for levels in the ConditionalDebug class. #438
Conversation
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.
Looks good. but I don't understand how it is backwards compatible with ConditionalDebug<false, "blah">
. Looks like that would create an Information level ConditionalDebug?
Edit: I upgraded my understanding as below.
sdk/include/debug.hh
Outdated
@@ -592,26 +666,31 @@ namespace | |||
* using Debug = ConditionalDebug<DebugFoo, "Foo">; |
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.
Does this comment need updating?
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.
Ah, that's what DebugLevelTemplateArgument is for. I still think you could update the comments.
@@ -676,6 +755,7 @@ namespace | |||
} | |||
} | |||
}; | |||
|
|||
/** | |||
* Function-like class for assertions that is expected to be used via | |||
* the deduction guide as: |
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.
Would it be useful to give Assertions a DebugLevel, like log messages?
Would be nice if one or more of the examples was updated to show how this can be uses. |
45e3c3e
to
e51d9aa
Compare
The class is now instantiated with a threshold level, from None to Error (for backwards compatibility, true means Information and false means None). Log messages also provide a log level (Information if none is provided) and will fire if the log level is greater than or equal to the threshold. The build system now has a `debugLevelOption` that allows specifying fine-grained levels. The existing `debugOption` works as before. The allocator is now extended to use `debugLevelOption`.
e51d9aa
to
cc7cbfc
Compare
The class is now instantiated with a threshold level, from None to Error (for backwards compatibility, true means Information and false means None).
Log messages also provide a log level (Information if none is provided) and will fire if the log level is greater than or equal to the threshold.