A data log background writer that periodically flushes the data log on a background thread.
More...
|
| DataLogBackgroundWriter (std::string_view dir="", std::string_view filename="", double period=0.25, std::string_view extraHeader="") |
| Construct a new Data Log.
|
|
| DataLogBackgroundWriter (wpi::Logger &msglog, std::string_view dir="", std::string_view filename="", double period=0.25, std::string_view extraHeader="") |
| Construct a new Data Log.
|
|
| DataLogBackgroundWriter (std::function< void(std::span< const uint8_t > data)> write, double period=0.25, std::string_view extraHeader="") |
| Construct a new Data Log that passes its output to the provided function rather than a file.
|
|
| DataLogBackgroundWriter (wpi::Logger &msglog, std::function< void(std::span< const uint8_t > data)> write, double period=0.25, std::string_view extraHeader="") |
| Construct a new Data Log that passes its output to the provided function rather than a file.
|
|
| ~DataLogBackgroundWriter () final |
|
| DataLogBackgroundWriter (const DataLogBackgroundWriter &)=delete |
|
DataLogBackgroundWriter & | operator= (const DataLogBackgroundWriter &)=delete |
|
| DataLogBackgroundWriter (DataLogBackgroundWriter &&)=delete |
|
DataLogBackgroundWriter & | operator= (const DataLogBackgroundWriter &&)=delete |
|
void | SetFilename (std::string_view filename) |
| Change log filename.
|
|
void | Flush () final |
| Explicitly flushes the log data to disk.
|
|
void | Pause () final |
| Pauses appending of data records to the log.
|
|
void | Resume () final |
| Resumes appending of data records to the log.
|
|
void | Stop () final |
| Stops appending all records to the log, and closes the log file.
|
|
virtual | ~DataLog ()=default |
|
| DataLog (const DataLog &)=delete |
|
DataLog & | operator= (const DataLog &)=delete |
|
| DataLog (DataLog &&)=delete |
|
DataLog & | operator= (const DataLog &&)=delete |
|
bool | HasSchema (std::string_view name) const |
| Returns whether there is a data schema already registered with the given name.
|
|
void | AddSchema (std::string_view name, std::string_view type, std::span< const uint8_t > schema, int64_t timestamp=0) |
| Registers a data schema.
|
|
void | AddSchema (std::string_view name, std::string_view type, std::string_view schema, int64_t timestamp=0) |
| Registers a data schema.
|
|
template<ProtobufSerializable T> |
void | AddProtobufSchema (ProtobufMessage< T > &msg, int64_t timestamp=0) |
| Registers a protobuf schema.
|
|
template<typename T , typename... I>
requires StructSerializable<T, I...> |
void | AddStructSchema (const I &... info, int64_t timestamp=0) |
| Registers a struct schema.
|
|
int | Start (std::string_view name, std::string_view type, std::string_view metadata={}, int64_t timestamp=0) |
| Start an entry.
|
|
void | Finish (int entry, int64_t timestamp=0) |
| Finish an entry.
|
|
void | SetMetadata (int entry, std::string_view metadata, int64_t timestamp=0) |
| Updates the metadata for an entry.
|
|
void | AppendRaw (int entry, std::span< const uint8_t > data, int64_t timestamp) |
| Appends a raw record to the log.
|
|
void | AppendRaw2 (int entry, std::span< const std::span< const uint8_t > > data, int64_t timestamp) |
| Appends a raw record to the log.
|
|
void | AppendBoolean (int entry, bool value, int64_t timestamp) |
| Appends a boolean record to the log.
|
|
void | AppendInteger (int entry, int64_t value, int64_t timestamp) |
| Appends an integer record to the log.
|
|
void | AppendFloat (int entry, float value, int64_t timestamp) |
| Appends a float record to the log.
|
|
void | AppendDouble (int entry, double value, int64_t timestamp) |
| Appends a double record to the log.
|
|
void | AppendString (int entry, std::string_view value, int64_t timestamp) |
| Appends a string record to the log.
|
|
void | AppendBooleanArray (int entry, std::span< const bool > arr, int64_t timestamp) |
| Appends a boolean array record to the log.
|
|
void | AppendBooleanArray (int entry, std::span< const int > arr, int64_t timestamp) |
| Appends a boolean array record to the log.
|
|
void | AppendBooleanArray (int entry, std::span< const uint8_t > arr, int64_t timestamp) |
| Appends a boolean array record to the log.
|
|
void | AppendIntegerArray (int entry, std::span< const int64_t > arr, int64_t timestamp) |
| Appends an integer array record to the log.
|
|
void | AppendFloatArray (int entry, std::span< const float > arr, int64_t timestamp) |
| Appends a float array record to the log.
|
|
void | AppendDoubleArray (int entry, std::span< const double > arr, int64_t timestamp) |
| Appends a double array record to the log.
|
|
void | AppendStringArray (int entry, std::span< const std::string > arr, int64_t timestamp) |
| Appends a string array record to the log.
|
|
void | AppendStringArray (int entry, std::span< const std::string_view > arr, int64_t timestamp) |
| Appends a string array record to the log.
|
|
void | AppendStringArray (int entry, std::span< const struct WPI_String > arr, int64_t timestamp) |
| Appends a string array record to the log.
|
|
A data log background writer that periodically flushes the data log on a background thread.
The data log file is created immediately upon construction with a temporary filename. The file may be renamed at any time using the SetFilename() function.
The lifetime of this object must be longer than any data log entry objects that refer to it.
The data log is periodically flushed to disk. It can also be explicitly flushed to disk by using the Flush() function. This operation is, however, non-blocking.