hamnet70/impl/src/jsonlogger.h
Thomas Kolb 2e91fd7c42 Apply free software+documentation licenses
All code is now licensed under GPLv3+. The documentation is licensed under
CC BY-SA 4.0.

This is now officially free software! \o/
2024-08-23 11:53:40 +02:00

38 lines
899 B
C

/*
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Copyright (C) 2024 Thomas Kolb
*/
#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