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

From: Kinkie <gkinkie_at_gmail.com>
Date: Tue, 6 Nov 2012 13:21:03 +0100

Hi,
  I tried it, it seems to be working. Expect a patch soon, along the
lines of your proposal.

On Tue, Nov 6, 2012 at 2:18 AM, Alex Rousskov
<rousskov_at_measurement-factory.com> wrote:
> 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.
>

-- 
    /kinkie
Received on Tue Nov 06 2012 - 12:21:12 MST

This archive was generated by hypermail 2.2.0 : Sat Nov 10 2012 - 12:00:12 MST