19#ifndef _VMTOOLS_LOG_H_
20#define _VMTOOLS_LOG_H_
136#if !defined(G_LOG_DOMAIN)
137# error "G_LOG_DOMAIN must be defined."
143# define FUNC __func__
145# define FUNC __FUNCTION__
161# define g_info(fmt, ...) g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, fmt, ## __VA_ARGS__)
166#define VMTOOLS_LOGGING_LEVEL_DEFAULT "info"
168#define VMTOOLS_LOGGING_LEVEL_DEFAULT "message"
191#if defined(_WIN32) && GLIB_CHECK_VERSION(2, 46, 0)
193g_critical_inline(
const gchar *fmt,
198 g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, fmt, args);
215#define vm_critical(fmt, ...) g_critical_inline("%s: " fmt, FUNC, ## __VA_ARGS__)
218g_debug_inline(
const gchar *fmt,
223 g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, fmt, args);
228#define vm_debug(fmt, ...) g_debug_inline("%s: " fmt, FUNC, ## __VA_ARGS__)
231g_error_inline(
const gchar *fmt,
236 g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, fmt, args);
241#define vm_error(fmt, ...) g_error_inline("%s: " fmt, FUNC, ## __VA_ARGS__)
245g_info_inline(
const gchar *fmt,
250 g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, fmt, args);
255#define vm_info(fmt, ...) g_info_inline("%s: " fmt, FUNC, ## __VA_ARGS__)
258g_message_inline(
const gchar *fmt,
263 g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, fmt, args);
268#define vm_message(fmt, ...) g_message_inline("%s: " fmt, FUNC, ## __VA_ARGS__)
271g_warning_inline(
const gchar *fmt,
276 g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, fmt, args);
281#define vm_warning(fmt, ...) g_warning_inline("%s: " fmt, FUNC, ## __VA_ARGS__)
298#define vm_critical(fmt, ...) g_critical("%s: " fmt, FUNC, ## __VA_ARGS__)
301#define vm_debug(fmt, ...) g_debug("%s: " fmt, FUNC, ## __VA_ARGS__)
304#define vm_error(fmt, ...) g_error("%s: " fmt, FUNC, ## __VA_ARGS__)
307#define vm_info(fmt, ...) g_info("%s: " fmt, FUNC, ## __VA_ARGS__)
310#define vm_message(fmt, ...) g_message("%s: " fmt, FUNC, ## __VA_ARGS__)
313#define vm_warning(fmt, ...) g_warning("%s: " fmt, FUNC, ## __VA_ARGS__)