1 // Copyright 2018 The Android Open Source Project
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 #include <cstdarg>
15
16 #include <stdio.h>
17 #include <inttypes.h>
18
19 #include "AndroidHostCommon.h"
20
21 #define LOG_BUF_SIZE 1024
22
23 extern "C" {
24
__android_log_print(int prio,const char * tag,const char * fmt,...)25 EXPORT int __android_log_print(int prio, const char* tag, const char* fmt, ...) {
26 va_list ap;
27 va_start(ap, fmt);
28 vfprintf(stdout, fmt, ap);
29 fprintf(stdout, "\n");
30 va_end(ap);
31 return 0;
32 }
33
__android_log_assert(const char * cond,const char * tag,const char * fmt,...)34 EXPORT void __android_log_assert(const char* cond, const char* tag, const char* fmt, ...) {
35 // Placeholder
36 }
37
__android_log_error_write(int tag,const char * subTag,int32_t uid,const char * data,uint32_t dataLen)38 EXPORT int __android_log_error_write(
39 int tag, const char* subTag, int32_t uid,
40 const char* data, uint32_t dataLen) {
41 printf("android_log_error_write: "
42 "tag: %d subtag: [%s] uid: %d datalen: %u data: [%s]\n",
43 tag, subTag, uid, dataLen, data);
44 return 0;
45 }
46
47 } // extern "C"
48