[wpiutil] Add C API for DataLog (#5509)

This commit is contained in:
Peter Johnson
2023-08-06 20:18:50 -07:00
committed by GitHub
parent b5bd0771eb
commit c01814b80e
5 changed files with 541 additions and 1 deletions

View File

@@ -588,6 +588,27 @@ void NT_SetNow(int64_t timestamp) {
nt::SetNow(timestamp);
}
NT_DataLogger NT_StartEntryDataLog(NT_Inst inst, struct WPI_DataLog* log,
const char* prefix, const char* logPrefix) {
return nt::StartEntryDataLog(inst, *reinterpret_cast<wpi::log::DataLog*>(log),
prefix, logPrefix);
}
void NT_StopEntryDataLog(NT_DataLogger logger) {
nt::StopEntryDataLog(logger);
}
NT_ConnectionDataLogger NT_StartConnectionDataLog(NT_Inst inst,
struct WPI_DataLog* log,
const char* name) {
return nt::StartConnectionDataLog(
inst, *reinterpret_cast<wpi::log::DataLog*>(log), name);
}
void NT_StopConnectionDataLog(NT_ConnectionDataLogger logger) {
nt::StopConnectionDataLog(logger);
}
NT_Listener NT_AddLogger(NT_Inst inst, unsigned int min_level,
unsigned int max_level, void* data,
NT_ListenerCallback func) {