Replies: 1 comment
-
It might be possible to put the logic to decide whether to log directly into the sink that is currently optional. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Our project has a debugging mechanism whereby based on a config option, we may want to also log to an additional, independent
absl::LogSink*
. HoweverToSinkAlso()
does not acceptnullptr
as a parameter - this is reasonable but forces us to use somewhat unsightly workarounds:Either:
or:
define a
class NoopLogSink : public absl::LogSink
whoseSend()
does nothing and has a global singleton. Then the code looks like:Is there a less ugly alternative that I'm missing? The only thing I can think of is to write a wrapper macro around all the
LOG
ones but it's a pretty big surface.Beta Was this translation helpful? Give feedback.
All reactions