X-TraceC++Library
|
#include <XtrReporter.h>
Static Public Member Functions | |
static void | init () |
Sets up any state required to have the class ready to send reports. | |
static void | stop () |
Cleans up any state set up at init. | |
static xtr_result | sendReport (const char *msg, u_int8_t severity=OptionSeverity::_DEFAULT, u_int8_t severityThreshold=OptionSeverity::_UNSET) |
Sends an X-Trace report to the Ctx's destination. | |
static xtr_result | willReport (u_int8_t severity, u_int8_t severityThreshold=OptionSeverity::_UNSET) |
Returns true if the reporter is initialized and severity <= effective severity threshold. | |
static xtr_result | setSeverityThreshold (u_int8_t severity) |
Severity settings. | |
static u_int8_t | getSeverityThreshold () |
Returns the currently set severity threshold. |
static u_int8_t xtr::Reporter::getSeverityThreshold | ( | ) | [static] |
Returns the currently set severity threshold.
static void xtr::Reporter::init | ( | ) | [static] |
Sets up any state required to have the class ready to send reports.
static xtr_result xtr::Reporter::sendReport | ( | const char * | msg, |
u_int8_t | severity = OptionSeverity::_DEFAULT , |
||
u_int8_t | severityThreshold = OptionSeverity::_UNSET |
||
) | [static] |
Sends an X-Trace report to the Ctx's destination.
Currently this means a local UDP socket running on port 7831.
msg | a null-terminated C-style string. It will not be changed and can be freed/overwritten after the call. |
severity | Severity of the event being reported |
severityThreshold | Severity threshold of the metadata in question. Unless this is equal to OptionSeverity::_UNSET, it overrides the internal severity_thresh of this reporter. |
static xtr_result xtr::Reporter::setSeverityThreshold | ( | u_int8_t | severity | ) | [static] |
Severity settings.
Sets the minimum severity messages must have to be reported.
severity | A message with numeric severity M will only be reported by the reporting context with severity threshold R if M <= R. Two special values are allowed:
|
static void xtr::Reporter::stop | ( | ) | [static] |
Cleans up any state set up at init.
static xtr_result xtr::Reporter::willReport | ( | u_int8_t | severity, |
u_int8_t | severityThreshold = OptionSeverity::_UNSET |
||
) | [static] |
Returns true if the reporter is initialized and severity <= effective severity threshold.
This function will serve as a HINT as to whether the reporter would report an event of *severity* for a task with severityThreshold. While the comparison is the same as the one made during actual reporting, the result may change if the internal severity threshold changes in between calls.
The effective severity threshold is given by: (severityThreshold == OptionSeverity::_UNSET)?severityThreshold:severity_thresh where severityThreshold is the argument (likely from the current metadata),
severity | Severity of the event being reported |
severityThreshold | Severity threshold of the metadata in question. Unless this is equal to OptionSeverity::_UNSET, it overrides the internal severity_thresh of this reporter. |