Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Inconsistent output from trace_logf: (2 Items)
   
Inconsistent output from trace_logf  
I'm using trace_logf to customize what is printed in the Data column of the Trace Event Log view.
e.g. 

     trace_logf(800, "read %d of %d chars", rc, charsleft) 

prints something like

     "string read 5 of 10 chars" 

next to User Event 800.

Most of the time it works just like that, but in a couple of cases I find it refuses to print the
desired string - instead I get output more like what I usually see from a direct call to TraceEvent, 
e.g. "d0 1802270050 d1 1601071455".  

The only differences I can see between the ones that give me the expected output and the ones 
that don't is that they have different code numbers and are in different locations in the source code.

Any idea what might override the formatting in trace_logf?

Re: Inconsistent output from trace_logf  
I've concluded it has nothing to do with the code number, or the location in the code.

I think what is happening is that in some locations the value I'm trying to print is somehow invalid,
and the tracelogger defaults to the "d0 d1" format whenever it doesn't know what to do.

Still TBD what's invalid about the values when this occurs, as I print the same variables elsewhere
without any trouble.