libdisplay-info/log.c
Simon Ser 7834b6ba22 info: introduce di_logger
This can be used by parsers (EDID, CTA, DisplayID, etc) to report
errors.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-04 08:40:36 +02:00

17 lines
372 B
C

#include "log.h"
void
_di_logger_va_add_failure(struct di_logger *logger, const char fmt[], va_list args)
{
if (!logger->initialized) {
if (ftell(logger->f) > 0) {
fprintf(logger->f, "\n");
}
fprintf(logger->f, "%s:\n", logger->section);
logger->initialized = true;
}
fprintf(logger->f, " ");
vfprintf(logger->f, fmt, args);
fprintf(logger->f, "\n");
}