1 #ifndef __MONO_LOGGER_INTERNAL_H__
2 #define __MONO_LOGGER_INTERNAL_H__
5 #include "mono-logger.h"
10 MONO_TRACE_ASSEMBLY = (1<<0),
11 MONO_TRACE_TYPE = (1<<1),
12 MONO_TRACE_DLLIMPORT = (1<<2),
13 MONO_TRACE_GC = (1<<3),
14 MONO_TRACE_CONFIG = (1<<4),
15 MONO_TRACE_AOT = (1<<5),
16 MONO_TRACE_SECURITY = (1<<6),
17 MONO_TRACE_ALL = MONO_TRACE_ASSEMBLY |
19 MONO_TRACE_DLLIMPORT |
27 mono_trace_cleanup (void);
30 mono_trace (GLogLevelFlags level, MonoTraceMask mask, const char *format, ...);
33 mono_tracev (GLogLevelFlags level, MonoTraceMask mask, const char *format, va_list args);
36 mono_trace_set_level (GLogLevelFlags level);
39 mono_trace_set_mask (MonoTraceMask mask);
42 mono_trace_push (GLogLevelFlags level, MonoTraceMask mask);
45 mono_trace_pop (void);
48 mono_trace_is_traced (GLogLevelFlags level, MonoTraceMask mask);
50 #ifdef G_HAVE_ISO_VARARGS
51 #define mono_trace_error(...) mono_trace(G_LOG_LEVEL_ERROR, \
53 #define mono_trace_warning(...) mono_trace(G_LOG_LEVEL_WARNING, \
55 #define mono_trace_message(...) mono_trace(G_LOG_LEVEL_MESSAGE, \
57 #elif defined(G_HAVE_GNUC_VARARGS)
58 #define mono_trace_error(format...) mono_trace(G_LOG_LEVEL_ERROR, \
60 #define mono_trace_warning(format...) mono_trace(G_LOG_LEVEL_WARNING, \
62 #define mono_trace_message(format...) mono_trace(G_LOG_LEVEL_MESSAGE, \
64 #else /* no varargs macros */
65 G_GNUC_UNUSED static void
66 mono_trace_error(MonoTraceMask mask, const char *format, ...)
69 va_start (args, format);
70 mono_tracev(G_LOG_LEVEL_ERROR, mask, format, args);
74 G_GNUC_UNUSED static void
75 mono_trace_warning(MonoTraceMask mask, const char *format, ...)
78 va_start (args, format);
79 mono_tracev(G_LOG_LEVEL_WARNING, mask, format, args);
83 G_GNUC_UNUSED static void
84 mono_trace_message(MonoTraceMask mask, const char *format, ...)
87 va_start (args, format);
88 mono_tracev(G_LOG_LEVEL_MESSAGE, mask, format, args);
92 #endif /* !__GNUC__ */
94 #if defined (PLATFORM_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
96 #define mono_gc_printf(gc_log_file, format, ...) g_log ("mono-gc", G_LOG_LEVEL_MESSAGE, format, ##__VA_ARGS__)
97 #define mono_runtime_printf(format, ...) g_log ("mono-rt", G_LOG_LEVEL_MESSAGE, format "\n", ##__VA_ARGS__)
98 #define mono_runtime_printf_err(format, ...) g_log ("mono-rt", G_LOG_LEVEL_CRITICAL, format "\n", ##__VA_ARGS__)
99 #define mono_runtime_stdout_fflush() do { } while (0)
103 #define mono_gc_printf(gc_log_file, format, ...) do { \
104 fprintf (gc_log_file, format, ##__VA_ARGS__); \
105 fflush (gc_log_file); \
108 #define mono_runtime_printf(format, ...) fprintf (stdout, format "\n", ##__VA_ARGS__)
109 #define mono_runtime_printf_err(format, ...) fprintf (stderr, format "\n", ##__VA_ARGS__)
110 #define mono_runtime_stdout_fflush() do { fflush (stdout); } while (0)
117 #endif /* __MONO_LOGGER_INTERNAL_H__ */