6#define __RTTracer_h__ included
10#include <RTJsonResult.h>
11#include <RTStreamBuffer.h>
45 static bool configure(
const char* configFile =
nullptr);
55 static RTS_INLINE
void note(
const char* text);
74 typedef std::chrono::system_clock::time_point
TraceTime;
97 PRECISION_MASK = 0x0F,
98 PRECISION_NANO = 0x09,
99 PRECISION_MICRO = 0x06,
100 PRECISION_MILLI = 0x03
102 static bool _enabled;
104 static bool _configured;
105 static std::string _applicationName;
106 static std::string _traceFileName;
107 static bool _overwriteFile;
111 static int _timestamps;
112 void printTimestamp(
const TraceTime& timestamp);
115 std::string _traceFile;
123 static std::string initTraceFile(
void);
125 static void getSenderInfo(
const RTMessage*, TraceInfo*);
130 void traceNote(
const char* text);
131 void traceNote_nolock(
const char* text);
139#define TRACE_TIME1 "time1_send"
140#define TRACE_TIME2 "time2_receive"
141#define TRACE_TIME3 "time3_handle"
144#include <RTTracer.inl>
An instance of this class represents a capsule instance.
Definition: RTActor.h:44
Represents the result of parsing a JSON string.
Definition: RTJsonResult.h:30
Represents a message used for communication between capsule instances.
Definition: RTMessage.h:33
Represents a general capsule port typed by a protocol which determines the set of events that can be ...
Definition: RTProtocol.h:50
Definition: RTStreamBuffer.h:22
Definition: RTTracer.h:20
std::chrono::system_clock::time_point TraceTime
Type for storing trace timestamps.
Definition: RTTracer.h:74
static bool isConfigured(void)
Check if tracing has been configured.
Definition: RTTracer.inl:20
static void note(const char *text)
Write a note to the trace.
Definition: RTTracer.inl:36
static bool configure(const char *configFile=nullptr)
Configure RTTracer and tracing preferences.
static void flushTrace(void)
Flush buffered trace messages to file.
Definition: RTTracer.inl:12
static bool isEnabled(void)
Check if tracing is enabled.
Definition: RTTracer.inl:16
TraceEventKind
Types of trace events supported.
Definition: RTTracer.h:60
static void setEnabled(bool)
Enable or disable tracing to file.
int flush(void) override
Flushes the data written to the buffer.
Structure with additional info passed to traceMessage call.
Definition: RTTracer.h:80