hamnet70/impl/src/jsonlogger.h

32 lines
808 B
C

#ifndef JSONLOGGER_H
#define JSONLOGGER_H
/*!
* \file
*
* \brief A structured logger.
*
* \details
* This module provides structured log output (in JSON format) for debugging
* purposes. It opens a named pipe (FIFO) and writes JSON objects to them as
* soon as a program opens the reading end.
*
* Each JSON object is written as a single line.
*/
#include <stdint.h>
#include <stdbool.h>
#include "debug_structs.h"
bool jsonlogger_init(const char *fifoname);
void jsonlogger_shutdown(void);
bool jsonlogger_log_simple_integer(const char *msg_type, int64_t value);
bool jsonlogger_log_simple_double(const char *msg_type, double value);
bool jsonlogger_log_rx_stats(const rx_stats_t *rx_stats);
bool jsonlogger_log_rx_packet_info(const rx_packet_dbg_t *rx_packet_dbg);
#endif // JSONLOGGER_H