redesign the message log functions

Add priority level and interface classifiers. Define macros
for all priority level types to keep the callers more readable.
Ensure the compatibility with previous logging mechanism.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2025-11-06 14:29:54 +01:00
parent 0a4e8854d5
commit 7248b0c660
6 changed files with 230 additions and 79 deletions

View file

@ -274,9 +274,8 @@ size_t snd_strlcat(char *dst, const char *src, size_t size);
*/
#ifndef NDEBUG
#define CHECK_SANITY(x) x
extern snd_lib_error_handler_t _snd_err_msg;
#define SNDMSG(args...) _snd_err_msg(__FILE__, __LINE__, __func__, 0, ##args)
#define SYSMSG(args...) _snd_err_msg(__FILE__, __LINE__, __func__, errno, ##args)
#define SNDMSG(args...) snd_lib_check(0, __FILE__, __LINE__, __func__, 0, ##args)
#define SYSMSG(args...) snd_lib_check(0, __FILE__, __LINE__, __func__, errno, ##args)
#else
#define CHECK_SANITY(x) 0 /* not evaluated */
#define SNDMSG(args...) /* nop */