Data Gator
Hardware and software documentation for the Data Gator project.
Loading...
Searching...
No Matches
logger.hpp File Reference

Logging Utilities for detecting and selecting logging interfaces. More...

This graph shows which files directly or indirectly include this file:

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
 

Detailed Description

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.

Author
Garret Wells

Function Documentation

◆ log_data()

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

Parameters
[in]topicThe MQTT topic to log
[in]messageThe message to log, likely JSON object

Variable Documentation

◆ reset_count

int reset_count
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.