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_THREADPOOL = (1<<7),
18 MONO_TRACE_ALL = MONO_TRACE_ASSEMBLY |
20 MONO_TRACE_DLLIMPORT |
29 mono_trace_cleanup (void);
32 mono_trace (GLogLevelFlags level, MonoTraceMask mask, const char *format, ...);
35 mono_tracev (GLogLevelFlags level, MonoTraceMask mask, const char *format, va_list args);
38 mono_trace_set_level (GLogLevelFlags level);
41 mono_trace_set_mask (MonoTraceMask mask);
44 mono_trace_push (GLogLevelFlags level, MonoTraceMask mask);
47 mono_trace_pop (void);
50 mono_trace_is_traced (GLogLevelFlags level, MonoTraceMask mask);
52 #ifdef G_HAVE_ISO_VARARGS
53 #define mono_trace_error(...) mono_trace(G_LOG_LEVEL_ERROR, \
55 #define mono_trace_warning(...) mono_trace(G_LOG_LEVEL_WARNING, \
57 #define mono_trace_message(...) mono_trace(G_LOG_LEVEL_MESSAGE, \
59 #elif defined(G_HAVE_GNUC_VARARGS)
60 #define mono_trace_error(format...) mono_trace(G_LOG_LEVEL_ERROR, \
62 #define mono_trace_warning(format...) mono_trace(G_LOG_LEVEL_WARNING, \
64 #define mono_trace_message(format...) mono_trace(G_LOG_LEVEL_MESSAGE, \
66 #else /* no varargs macros */
67 G_GNUC_UNUSED static void
68 mono_trace_error(MonoTraceMask mask, const char *format, ...)
71 va_start (args, format);
72 mono_tracev(G_LOG_LEVEL_ERROR, mask, format, args);
76 G_GNUC_UNUSED static void
77 mono_trace_warning(MonoTraceMask mask, const char *format, ...)
80 va_start (args, format);
81 mono_tracev(G_LOG_LEVEL_WARNING, mask, format, args);
85 G_GNUC_UNUSED static void
86 mono_trace_message(MonoTraceMask mask, const char *format, ...)
89 va_start (args, format);
90 mono_tracev(G_LOG_LEVEL_MESSAGE, mask, format, args);
94 #endif /* !__GNUC__ */
96 #if defined (PLATFORM_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
98 #define mono_gc_printf(gc_log_file, format, ...) g_log ("mono-gc", G_LOG_LEVEL_MESSAGE, format, ##__VA_ARGS__)
99 #define mono_runtime_printf(format, ...) g_log ("mono-rt", G_LOG_LEVEL_MESSAGE, format "\n", ##__VA_ARGS__)
100 #define mono_runtime_printf_err(format, ...) g_log ("mono-rt", G_LOG_LEVEL_CRITICAL, format "\n", ##__VA_ARGS__)
101 #define mono_runtime_stdout_fflush() do { } while (0)
105 #define mono_gc_printf(gc_log_file, format, ...) do { \
106 fprintf (gc_log_file, format, ##__VA_ARGS__); \
107 fflush (gc_log_file); \
110 #define mono_runtime_printf(format, ...) fprintf (stdout, format "\n", ##__VA_ARGS__)
111 #define mono_runtime_printf_err(format, ...) fprintf (stderr, format "\n", ##__VA_ARGS__)
112 #define mono_runtime_stdout_fflush() do { fflush (stdout); } while (0)
119 #endif /* __MONO_LOGGER_INTERNAL_H__ */