VRS
A file format for sensor data.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
vrs::TelemetryLogger Class Reference

TelemetryLogger to report important events. More...

#include <TelemetryLogger.h>

Public Member Functions

virtual void logEvent (LogEvent &&event)
 Actual methods that implement the behaviors.
 
virtual void logTraffic (const OperationContext &operationContext, const TrafficEvent &event)
 
virtual void flushEvents ()
 
virtual void start ()
 Start telemetry: background threads should be started, as needed.
 
virtual void stop ()
 

Static Public Member Functions

static void setLogger (std::unique_ptr< TelemetryLogger > telemetryLogger=nullptr)
 
static void error (const OperationContext &operationContext, const string &message, const string &serverMessage={})
 methods for clients to use without having to get an instance, etc
 
static void warning (const OperationContext &operationContext, const string &message, const string &serverMessage={})
 
static void info (const OperationContext &operationContext, const string &message, const string &serverMessage={})
 
static void event (const std::string &eventType, const OperationContext &operationContext, const string &message, const string &serverMessage={})
 
static void traffic (const OperationContext &operationContext, const TrafficEvent &event)
 
static void flush ()
 

Static Public Attributes

static constexpr const char * kErrorType = "error"
 
static constexpr const char * kWarningType = "warning"
 
static constexpr const char * kInfoType = "info"
 

Detailed Description

TelemetryLogger to report important events.

Telemetry building block infra to report events from VRS operations. The default implementation simply logs using XR_LOGI and XR_LOGE, XR_LOGW, but can easily be augmented to implement telemetry in a central database.

Member Function Documentation

◆ setLogger()

void vrs::TelemetryLogger::setLogger ( std::unique_ptr< TelemetryLogger telemetryLogger = nullptr)
static

Change active telemetry logger. The new logger will be started after assignment, and the old one will be stopped after.

Parameters
telemetryLoggernew TelemetryLogger, or nullptr for default logger.

◆ stop()

virtual void vrs::TelemetryLogger::stop ( )
inlinevirtual

End telemetry: All background threads should be stopped. All pending events should be flushed, and further events should be ignored.


The documentation for this class was generated from the following files: