This could work, but maybe something like:<br><br>LOGIF_ALL(Flags, ...)<br>LOGIF_ANY(Flags, ...)<br><br>WARNIF_ALL(Flags, ...)<br>WARNIF_ANY(Flags, ...)<br><br>You have to reevaluate the flags every time, but that's only one comparison and a bitwise operation, and it gives extra flexibility because you can have log on many different conditions in the same function <br><div class="gmail_quote">On Thu, Apr 30, 2015 at 1:13 AM Pavel Labath <<a href="mailto:labath@google.com">labath@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've been also thinking about this, but afraid to suggest anything. :)<br>
Anyway, now that the topic is up...<br>
<br>
If we want to decrease visual noise *and* avoid performance impact,<br>
why not make it a macro? E.g., something like<br>
#define LOGIF(log, ...) if(log) log->Printf(__VA_ARGS__)<br>
<br>
I know macros aren't really a thing right now, but I think this is a<br>
rather simple one and will improve readability without any performance<br>
impact.<br>
<br>
two cents.<br>
<br>
cheers,<br>
pl<br>
<br>
<br>
<br>
On 30 April 2015 at 07:44, Jason Molenda <<a href="mailto:jason@molenda.com" target="_blank">jason@molenda.com</a>> wrote:<br>
><br>
>> On Apr 29, 2015, at 7:23 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>
>><br>
>> 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.<br>
>><br>
><br>
><br>
> My two cents, I agree with Jim on this, I'd prefer we maintain the current form of logging throughout the codebase.<br>
><br>
> 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.<br>
><br>
> J<br>
> _______________________________________________<br>
> lldb-commits mailing list<br>
> <a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>