LogUtilities 1.5.1
A small compiled library for C logging and configuration utility functions.
|
Functions for reading from log or config files. More...
Functions | |
FILE * | openLogForReading (const char *subject, uint16_t YYYY, uint8_t MM, uint8_t DD, const char *tag, uint16_t index, HeaderData *headerData, Config *config, const char *configFile) |
Opens a log file for reading. | |
int | readConfig (Config *config, const char *configFileIn) |
Read the configuration from the config.yaml file. | |
int | readFileHeader (FILE *logFile, HeaderData *headerData) |
Reads the header data from the log file. | |
Functions for reading from log or config files.
FILE * openLogForReading | ( | const char * | subject, |
uint16_t | YYYY, | ||
uint8_t | MM, | ||
uint8_t | DD, | ||
const char * | tag, | ||
uint16_t | index, | ||
HeaderData * | headerData, | ||
Config * | config, | ||
const char * | configFile ) |
Opens a log file for reading.
This function constructs the full path to the log file based on the provided parameters, opens the file for reading, and reads the header information from the file.
subject | The subject of the log file. |
YYYY | Year. |
MM | Month. |
DD | Day. |
tag | The tag of the log file. |
index | The index of the log file. |
headerData | Pointer to the header data structure to store the read header information. |
config | Pointer to the logger configuration. |
configFile | The file and path of the configuration file. |
int readConfig | ( | Config * | config, |
const char * | configFileIn ) |
Read the configuration from the config.yaml file.
config | Pointer to the configuration structure. |
configFileIn | String corresponding to name of the config file, or NULL to use default ("config.yaml" in executable folder). |
int readFileHeader | ( | FILE * | logFile, |
HeaderData * | headerData ) |
Reads the header data from the log file.
logFile | Pointer to the log file. |
headerData | Pointer to the header data structure. |