This is only done in developer mode. It is a pretty rare occurence that we
make this kind of mistake. And even if it happens, the result is just a misleading
error message. So let's only do the check in non-release builds.
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
+#include <string.h>
#include <syslog.h>
#include "macro.h"
_e < 0 ? _e : -EIO; \
})
-#define log_full(level, ...) (void) log_full_errno((level), 0, __VA_ARGS__)
+#define log_full(level, fmt, ...) \
+ ({ \
+ if (BUILD_MODE_DEVELOPER) \
+ assert(!strstr(fmt, "%m")); \
+ (void) log_full_errno((level), 0, fmt, ##__VA_ARGS__); \
+ })
int log_emergency_level(void);