[wpiutil] Add DataLog and DataLogManager Stop() (#5860)

Restarting a stopped log results in creating a new log file with fresh copies of the same start records and schema data records.

Also check to see if the file has been deleted or if the log file exceeds 1.8 GB, and start a new one.
This commit is contained in:
Peter Johnson
2023-11-03 20:34:43 -07:00
committed by GitHub
parent 2a04e12c6f
commit f1a82828fe
11 changed files with 398 additions and 135 deletions

View File

@@ -52,6 +52,11 @@ class DataLogManager final {
static void Start(std::string_view dir = "", std::string_view filename = "",
double period = 0.25);
/**
* Stop data log manager.
*/
static void Stop();
/**
* Log a message to the "messages" entry. The message is also printed to
* standard output (followed by a newline).
@@ -110,6 +115,11 @@ struct WPI_DataLog;
*/
void DLM_Start(const char* dir, const char* filename, double period);
/**
* Stop data log manager.
*/
void DLM_Stop(void);
/**
* Log a message to the "messages" entry. The message is also printed to
* standard output (followed by a newline).