aboutsummaryrefslogtreecommitdiffstats
path: root/libparc/parc/algol
diff options
context:
space:
mode:
authorAngelo Mantellini <manangel@cisco.com>2019-09-20 16:58:12 +0200
committerAngelo Mantellini <manangel@cisco.com>2019-09-26 16:27:07 +0200
commite739ca2affa1237089857b5e1c87afeac25449aa (patch)
tree06dc74c35209a6ae8e7d9756cee0ed6e782f7153 /libparc/parc/algol
parent79445435d86aea92f85a1c0398ccada48af578e5 (diff)
[HICN-284] Android log for libparc
Signed-off-by: Angelo Mantellini <manangel@cisco.com> Change-Id: Iaec9ec7cd125eb4f9a391cd917a85a972e1c50b2
Diffstat (limited to 'libparc/parc/algol')
-rw-r--r--libparc/parc/algol/parc_FileOutputStream.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libparc/parc/algol/parc_FileOutputStream.c b/libparc/parc/algol/parc_FileOutputStream.c
index c119e67f..b11280aa 100644
--- a/libparc/parc/algol/parc_FileOutputStream.c
+++ b/libparc/parc/algol/parc_FileOutputStream.c
@@ -17,6 +17,10 @@
#include <unistd.h>
#endif
+#ifdef __ANDROID__
+#include <android/log.h>
+#endif
+
#include <config.h>
#include <stdio.h>
@@ -74,10 +78,14 @@ parcFileOutputStream_Write(PARCFileOutputStream *outputStream, PARCBuffer *buffe
size_t remaining = parcBuffer_Remaining(buffer);
size_t chunkSize = remaining > maximumChunkSize ? maximumChunkSize : remaining;
void *buf = parcBuffer_Overlay(buffer, chunkSize);
+#ifdef __ANDROID__
+ __android_log_print(ANDROID_LOG_INFO,"PARC", "%.*s", (int)chunkSize, buf);
+#else
ssize_t nwritten = write(outputStream->fd, buf, (unsigned int)chunkSize);
if (nwritten == -1) {
break;
}
+#endif
}
return parcBuffer_HasRemaining(buffer) == false;