Re: [MERGE] debugs message improvement: use HERE macro wherever sensible

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Mon, 05 Nov 2012 18:18:26 -0700

On 11/05/2012 05:25 PM, Amos Jeffries wrote:
> On 06.11.2012 04:19, Alex Rousskov wrote:
>> My current preference is to change debugs() to use HERE when the
>> surrounding code has to be changed anyway OR when there is a good reason
>> to add HERE to that specific debugs() line.
>>
>> Long-term, we should consider making HERE in debugs() at level 2 or
>> higher an automatic/default behavior. This will require some work, but I
>> think it is possible, and I think it can even accommodate existing
>> debugs() statements (with or without HERE) _without_ changing them.

> Me too. If you are agreeing on that then it is a 1 line change to add
> HERE every level 2+ ... and thousands of lines to remove cruft.

I would just not do the "remove explicit HERE" part to avoid changing
thousands of lines that do not really need to be touched. New and
changed code will not be allowed to use HERE in debugs(2+). Old code can
continue to use it.

For this plan to work, we would need to #define HERE to be something
that does not log anything and that does it fast. For example, "" will
work but there ought to be faster alternatives. I recommend trying an
inlined stream manipulator that will be completely optimized out.

HTH,

Alex.
Received on Tue Nov 06 2012 - 01:18:29 MST

This archive was generated by hypermail 2.2.0 : Tue Nov 06 2012 - 12:00:04 MST