1 //******************************************************************
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
25 * Created on: Mar 27, 2014
28 #include "SimpleLogger.h"
31 #include <android/log.h>
37 void LOG(const char * format, ...) {
40 va_start (args, format);
41 __android_log_vprint(ANDROID_LOG_INFO, "CCF-Lite-ANDROID", format, args);
43 #elif defined __linux__
44 printf("INFO: CCF-Lite-LINUX: ");
46 va_start (args, format);
47 vprintf(format, args);
53 void logDebug(const char * tag, const char * format, ...) {
56 va_start (args, format);
57 __android_log_vprint(ANDROID_LOG_DEBUG, tag, format, args);
59 #elif defined __linux__
60 printf("DEBUG: %s: ", tag);
62 va_start (args, format);
63 vprintf(format, args);
68 void logInfo(const char * tag, const char * format, ...) {
71 va_start (args, format);
72 __android_log_vprint(ANDROID_LOG_INFO, tag, format, args);
74 #elif defined __linux__
75 printf("INFO: %s: ", tag);
77 va_start (args, format);
78 vprintf(format, args);
84 void logWarn(const char * tag, const char * format, ...) {
87 va_start (args, format);
88 __android_log_vprint(ANDROID_LOG_WARN, tag, format, args);
90 #elif defined __linux__
91 printf("WARN: %s: ", tag);
93 va_start (args, format);
94 vprintf(format, args);
100 void logError(const char * tag, const char * format, ...) {
103 va_start (args, format);
104 __android_log_vprint(ANDROID_LOG_ERROR, tag, format, args);
106 #elif defined __linux__
107 printf("ERROR: %s: ", tag);
109 va_start (args, format);
110 vprintf(format, args);
116 void logFatal(const char * tag, const char * format, ...) {
119 va_start (args, format);
120 __android_log_vprint(ANDROID_LOG_FATAL, tag, format, args);
122 #elif defined __linux__
123 printf("FATAL: %s: ", tag);
125 va_start (args, format);
126 vprintf(format, args);