Tracing - new expression and suppression
Posted: Tue Jul 22, 2008 11:08 pm
I've been using tracing and it turned out the info I wanted to see ( variables) was getting lost in the the file/line/class position info.
I added a new (additional) trace form 'trace print' that prints its expression list without the position info.
In addition if any of the expressions is a String it prints just that (without the 'name=') part.
e.g.
(Another possibility would be to change Tracer.trace to put the position info first with the trace expressions after them...??)
While testing this I found theres no compile-time suppression of tracing (as there is for tests, asserts, nil checking) etc
(I'm presuming that was just an oversight or not yet got to item ??)
so I added that as well.
new commandline option -include-traces default yes
and had it also switched off for the -turbo option switch
Any utility to anyone else for all or part of this ?
I added a new (additional) trace form 'trace print' that prints its expression list without the position info.
In addition if any of the expressions is a String it prints just that (without the 'name=') part.
e.g.
- Code: Select all
trace print r, v # gives trace: r=<rvalue> v=<vvalue>
trace print 'searchHook'', r , 'value=[v]' # gives trace: SearchHook r=<rValue> value=<vvalue>
(Another possibility would be to change Tracer.trace to put the position info first with the trace expressions after them...??)
While testing this I found theres no compile-time suppression of tracing (as there is for tests, asserts, nil checking) etc
(I'm presuming that was just an oversight or not yet got to item ??)
so I added that as well.
new commandline option -include-traces default yes
and had it also switched off for the -turbo option switch
- Code: Select all
cobra -include-traces:no file.cobra
Any utility to anyone else for all or part of this ?