[Lldb-commits] [lldb] r236174 - Introduce a NullLog class, which ignores all messages.
labath at google.com
Thu Apr 30 01:12:54 PDT 2015
I've been also thinking about this, but afraid to suggest anything. :)
Anyway, now that the topic is up...
If we want to decrease visual noise *and* avoid performance impact,
why not make it a macro? E.g., something like
#define LOGIF(log, ...) if(log) log->Printf(__VA_ARGS__)
I know macros aren't really a thing right now, but I think this is a
rather simple one and will improve readability without any performance
On 30 April 2015 at 07:44, Jason Molenda <jason at molenda.com> wrote:
>> On Apr 29, 2015, at 7:23 PM, Zachary Turner <zturner at google.com> wrote:
>> What do you think about Enrico's suggestion? If there's a way to make this useful for everyone it's certainly better than me doing my own thing in ProcessWindows, but when i look at my code decorated with log statements using the existing paradigm, it's significantly harder to read than using the NullLog paradigm, so i guess i will still move it to ProcessWindows if that's the only way.
> My two cents, I agree with Jim on this, I'd prefer we maintain the current form of logging throughout the codebase.
> In the unwinder, I wanted to have a consistent format style for all my logging -- in RegisterContextLLDB all of the logging calls UnwindLogMsg() unconditionally. In that method I check if logging is enabled and add the standard formatting before the msg.
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
More information about the lldb-commits