User Tools

Site Tools


tools:logger_trace:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tools:logger_trace:start [2018/05/25 09:46] graftools:logger_trace:start [2018/08/22 11:56] (current) – external edit 127.0.0.1
Line 42: Line 42:
  
 ===== Concurrent Writing of Trace Data ===== ===== Concurrent Writing of Trace Data =====
-The example above shows how a trace buffer can be written to a file. This has to be done only after the executor stopped, because the writing usually takes a long time. If you wish to write a trace buffer to a file for further analysis while the application still runs, you can use a ''TraceWriter''. This will do the writing in a separate thread and hence does not block the safety system or control system, see ''examples/controlSystem/traceTest''Every 30 seconds the trace buffer gets written to a file.+The example above shows how a trace buffer can be written to a file. This has to be done only after the executor stopped, because the writing usually takes a long time. If you wish to write a trace buffer to a file for further analysis while the application still runs, you can use a ''TraceWriter''. This will do the writing in a separate thread and hence does not block the safety system or control system, see ''examples/controlSystem/traceTest''In this example the trace buffer gets written to a file every 30 seconds.
 <code cpp> <code cpp>
-    if (slRunning.getNofActivations() % (int)(30 / period) == 0) {// write to log file every 30s +  TraceWriter<Vector3> tw(cs.trace2, "/tmp/ctrlData"); 
-      new TraceWriter<Vector3>(cs.trace2, "/tmp/ctrlData.txt"); + 
-    }+  if (slRunning.getNofActivations() % (int)(30 / period) == 0) { // write to log file every 30s 
 +    tw.write(); 
 +  }
 </code> </code>
 +The name of the trace file will be appended with the current date and time.
tools/logger_trace/start.1527234362.txt.gz · Last modified: 2018/05/25 09:46 by graf