Document return values
[ACE_TAO.git] / ACE / ace / Log_Msg_Android_Logcat.cpp
blob1bdba36db1505854c62e013542cd97a7be61c3cb
1 #include "ace/config-all.h"
3 #ifdef ACE_ANDROID
5 #include <android/log.h> // Android Logging Functions
7 #include "ace/ACE.h"
8 #include "ace/Log_Category.h"
9 #include "ace/Log_Msg_Android_Logcat.h"
10 #include "ace/Log_Record.h"
11 #include "ace/OS_NS_string.h"
13 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
15 /**
16 * Convert ACE Log Priority to Android Logcat Priority
18 static android_LogPriority
19 convert_log_priority (ACE_Log_Priority lm_priority)
21 switch (lm_priority) {
22 case LM_TRACE:
23 case LM_DEBUG:
24 return ANDROID_LOG_DEBUG;
25 case LM_STARTUP:
26 case LM_SHUTDOWN:
27 case LM_INFO:
28 case LM_NOTICE:
29 return ANDROID_LOG_INFO;
30 case LM_WARNING:
31 return ANDROID_LOG_WARN;
32 case LM_CRITICAL:
33 case LM_ALERT:
34 case LM_EMERGENCY:
35 return ANDROID_LOG_FATAL;
36 case LM_ERROR:
37 default:
38 return ANDROID_LOG_ERROR;
42 ACE_Log_Msg_Android_Logcat::~ACE_Log_Msg_Android_Logcat ()
44 this->close ();
47 int
48 ACE_Log_Msg_Android_Logcat::open (const ACE_TCHAR *)
50 return 0;
53 int
54 ACE_Log_Msg_Android_Logcat::reset ()
56 return close ();
59 int
60 ACE_Log_Msg_Android_Logcat::close ()
62 return 0;
65 ssize_t
66 ACE_Log_Msg_Android_Logcat::log (ACE_Log_Record &log_record)
68 __android_log_write (
69 convert_log_priority (static_cast<ACE_Log_Priority> (log_record.type ())),
70 "ACE",
71 log_record.msg_data ());
72 return 0;
75 ACE_END_VERSIONED_NAMESPACE_DECL
77 #endif