![]() |
Data Gator
Hardware and software documentation for the Data Gator project.
|
Logging Utilities for detecting and selecting logging interfaces. More...
Go to the source code of this file.
Functions | |
void | log_data (std::string topic, std::string message) |
Variables | |
int | reset_count |
number of resets retrieved for NVS | |
Logging Utilities for detecting and selecting logging interfaces.
Defines the high-level wrapper for logging data on the Data Gator (DG). Currently this consists of a single function log_data
which takes the data strings to be logged and logs them to all available logging destinations such as MQTT and the SD card.
Data destinations are controlled by whether their 'is available' flag is set to true
. This flag is first set in the user configuration files but can be overridden if the interface cannot be initialized during setup.
void log_data | ( | std::string | topic, |
std::string | message | ||
) |
Helper function that handles all data logging to MQTT and the SD card automatically.
IF (there is a WiFi connection) -> log to MQTT broker
IF (there is a SD card) -> log to SD card
[in] | topic | The MQTT topic to log |
[in] | message | The message to log, likely JSON object |
|
extern |
number of resets retrieved for NVS
External variable holding the number of resets recorded by the system. Stored and loaded from non-volatile storage.