Differentiate messages in the log files if they are caused by an hardware issue

This commit is contained in:
Andrea Mazzoleni 2026-02-01 20:21:28 +01:00
parent 85f3f0217c
commit d3f7bf64c1
33 changed files with 934 additions and 886 deletions

View file

@ -73,6 +73,11 @@ uint64_t random_u64(void);
/****************************************************************************/
/* log */
/**
* Pointer to log function.
*/
typedef void log_ptr(int err, const char* format, ...) __attribute__((format(attribute_printf, 2, 3)));
/**
* Fatal error messages.
*
@ -80,7 +85,7 @@ uint64_t random_u64(void);
*
* These messages go in the log file and in stderr unconditionally.
*/
void log_fatal(const char* format, ...) __attribute__((format(attribute_printf, 1, 2)));
void log_fatal(int err, const char* format, ...) __attribute__((format(attribute_printf, 2, 3)));
/**
* Unexpected error messages.
@ -93,7 +98,7 @@ void log_fatal(const char* format, ...) __attribute__((format(attribute_printf,
*
* These messages go in the log file if specified, otherwise they go in stderr.
*/
void log_error(const char* format, ...) __attribute__((format(attribute_printf, 1, 2)));
void log_error(int err, const char* format, ...) __attribute__((format(attribute_printf, 2, 3)));
/**
* Expected error messages, without fallback to stderr.
@ -104,7 +109,7 @@ void log_error(const char* format, ...) __attribute__((format(attribute_printf,
*
* These messages go in the log file if specified, otherwise they are lost.
*/
void log_expected(const char* format, ...) __attribute__((format(attribute_printf, 1, 2)));
void log_expected(int err, const char* format, ...) __attribute__((format(attribute_printf, 2, 3)));
/**
* Tag messages.
@ -124,14 +129,14 @@ void log_tag(const char* format, ...) __attribute__((format(attribute_printf, 1,
*/
void log_flush(void);
/**
* Pointer to log function.
*/
typedef void fptr(const char* format, ...) __attribute__((format(attribute_printf, 1, 2)));
/****************************************************************************/
/* message */
/**
* Pointer to msg function.
*/
typedef void msg_ptr(const char* format, ...) __attribute__((format(attribute_printf, 1, 2)));
/**
* Message levels.
*