vlc | branch: master | Rémi Denis-Courmont <[email protected]> | 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().

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to