Commit graph

7 commits

Author SHA1 Message Date
Thomas Kolb 0e8e049e0a Replace all perror() calls with LOG() 2024-05-30 11:02:08 +02:00
Simon Ruderich 5fb5a2908d jsonlogger: increase pipe buffer to reduce likelihood of corrupted messages
Our JSON messages can get rather large which can cause a buffer overrun
when the reading program is not scheduled at the same time. When the
kernel returns EAGAIN we abort writing the current JSON message.
However, the unfinished (and thus invalid) JSON message is still in the
pipe and will be processed by the reading program.

Increase the pipe buffer from the default 65536 to reduce the likelihood
of this happening. It's difficult to completely prevent the issue as we
don't want to slow down the main program due to slow logging.
2024-05-28 08:51:56 +02:00
Simon Ruderich a4e55f781b Always NUL-terminate path in jsonlogger_init() 2024-05-09 18:32:26 +02:00
Simon Ruderich f689c4ec15 Fix compiler warnings
- implicit declaration of built-in function 'strncpy'
- control reaches end of non-void function
- assignment to 'void (*)(int,  siginfo_t *, void *)' from incompatible pointer type 'void (*)(int)'
2024-05-09 14:37:39 +02:00
Thomas Kolb a42d795002 Dump debug info from the RX via jsonlogger 2024-05-07 21:40:29 +02:00
Thomas Kolb 5bcd3a6933 jsonlogger: add test file and improve open/close behaviour 2024-05-05 18:40:50 +02:00
Thomas Kolb 251aca7738 Basic implementation of a JSON logger module 2024-05-05 18:09:00 +02:00