Hi all, here's the promised patch. It's actually even simpler than what Alex was suggesting. Run-tested.
On Tue, Nov 6, 2012 at 1:21 PM, Kinkie <[email protected]> wrote: > 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 > <[email protected]> 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 -- /kinkie
debugs-autohere.patch
Description: Binary data
