[vlc-commits] messages: add macros for logging with a logger
Rémi Denis-Courmont
git at videolan.org
Mon Mar 4 21:05:54 CET 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Mar 4 20:33:49 2019 +0200| [70151a63beee62f7005784c3635371c3eda4e006] | committer: Rémi Denis-Courmont
messages: add macros for logging with a logger
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=70151a63beee62f7005784c3635371c3eda4e006
---
include/vlc_messages.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/vlc_messages.h b/include/vlc_messages.h
index ba0646780f..b6d5843985 100644
--- a/include/vlc_messages.h
+++ b/include/vlc_messages.h
@@ -128,6 +128,14 @@ VLC_API void vlc_vaLog(struct vlc_logger *const *logger, int prio,
const char *file, unsigned line, const char *func,
const char *format, va_list ap);
+#define vlc_log_gen(logger, prio, ...) \
+ vlc_Log(&(logger), prio, "generic", vlc_module_name, \
+ __FILE__, __LINE__, __func__, __VA_ARGS__)
+#define vlc_info(logger, ...) vlc_log_gen(logger, VLC_MSG_INFO, __VA_ARGS__)
+#define vlc_error(logger, ...) vlc_log_gen(logger, VLC_MSG_ERR, __VA_ARGS__)
+#define vlc_warning(logger, ...) vlc_log_gen(logger, VLC_MSG_WARN, __VA_ARGS__)
+#define vlc_debug(logger, ...) vlc_log_gen(logger, VLC_MSG_DBG, __VA_ARGS__)
+
/**
* Message logging callback signature.
* \param data data pointer as provided to vlc_msg_SetCallback().
More information about the vlc-commits
mailing list