3 * Android-specific interface to the logger
5 * This module contains the Android logcat logger interface
8 * Marek Habersack <grendel@twistedcode.net>
13 #if defined (PLATFORM_ANDROID)
15 #include <android/log.h>
16 #include "mono-logger-internals.h"
19 * mono_log_open_logcat:
21 * \param userData Unused
22 * Open access to Android logcat (no-op)
25 mono_log_open_logcat (const char *path
, void *userData
)
27 /* No-op on Android */
31 * mono_log_write_logcat:
32 * \param domain Identifier string
33 * \param level Logging level flags
34 * \param format \c printf format string
35 * \param vargs Variable argument list
36 * Write data to Android logcat.
39 mono_log_write_logcat (const char *log_domain
, GLogLevelFlags level
, mono_bool hdr
, const char *message
)
41 android_LogPriority apriority
;
43 switch (level
& G_LOG_LEVEL_MASK
)
45 case G_LOG_LEVEL_ERROR
:
46 apriority
= ANDROID_LOG_FATAL
;
49 case G_LOG_LEVEL_CRITICAL
:
50 apriority
= ANDROID_LOG_ERROR
;
53 case G_LOG_LEVEL_WARNING
:
54 apriority
= ANDROID_LOG_WARN
;
57 case G_LOG_LEVEL_MESSAGE
:
58 apriority
= ANDROID_LOG_INFO
;
61 case G_LOG_LEVEL_INFO
:
62 apriority
= ANDROID_LOG_DEBUG
;
65 case G_LOG_LEVEL_DEBUG
:
66 apriority
= ANDROID_LOG_VERBOSE
;
70 apriority
= ANDROID_LOG_UNKNOWN
;
74 __android_log_write (apriority
, log_domain
, message
);
75 if (apriority
== ANDROID_LOG_FATAL
)
80 * mono_log_close_logcat
82 * Close access to Android logcat (no-op)
85 mono_log_close_logcat ()
87 /* No-op on Android */