Commit eee9ad2b authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

log: Add pr_warn_once helper

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8dd41341
......@@ -61,6 +61,15 @@ extern void print_on_level(unsigned int loglevel, const char *format, ...)
"Warn (%s:%d): " LOG_PREFIX fmt, \
__FILE__, __LINE__, ##__VA_ARGS__)
#define pr_warn_once(fmt, ...) \
do { \
static bool __printed; \
if (!__printed) { \
pr_warn(fmt, ##__VA_ARGS__); \
__printed = 1; \
} \
} while (0)
#define pr_debug(fmt, ...) \
print_on_level(LOG_DEBUG, \
LOG_PREFIX fmt, ##__VA_ARGS__)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment