| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Traces and logs the contents of one or more variables.
TraceLog( <xVariables,...> ) --> lTrue
The function returns .T. (true).
The TraceLog() function traces and logs the contents of one or more variables in the trace log file. Each time TraceLog() is called, a new entry is added to the log file. To suppress output of the function SET TRACE must be set to OFF.
| See also: | AltD(), HB_BldLogMsg(), INIT LOG, SET ERRORLOG, SET TRACE |
| Category: | Debug functions , Log functions , xHarbour extensions |
| Source: | rtl\traceprg.prg |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// This example logs the contents of three variables in the trace.log file. The
// log contains type and value of the variables as well as the line number,
// procedure and source file where the trace was executed.
PROCEDURE Main()
LOCAL xValue1 := 1
LOCAL xValue2 := 1
LOCAL xValue3 := 1
TraceLog( xValue1, xValue2, xValue3 )
xValue1 := 2
xValue2 := 33
xValue3 := xValue1 + xValue2
TraceLog( xValue1, xValue2, xValue3 )
xValue1 := Str(++xValue1)
xValue2 := 33
xValue3 := xValue2++
TraceLog( xValue1, xValue2, xValue3 )
MemoEdit( Memoread( "Trace.log" ) )
RETURN
http://www.xHarbour.com