summaryrefslogtreecommitdiffstats
path: root/libtransport
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2020-02-11 10:36:56 +0100
committerMauro Sardara <msardara@cisco.com>2020-02-11 10:36:56 +0100
commit0e016eba61b2918feed39bb6eaf2d093f45b9581 (patch)
tree892ed42b8b940ac818ca5aa9a7a463c612c1b50b /libtransport
parent202c6bc2788c943b15026c24900c321b9bbeed3c (diff)
[HICN-511] Added android log for libhicntransport
Change-Id: I566939e02d7f2c8be6be9665d32c09f4737f69e1 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport')
-rw-r--r--libtransport/src/hicn/transport/utils/log.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/libtransport/src/hicn/transport/utils/log.cc b/libtransport/src/hicn/transport/utils/log.cc
index 00bd7d54f..27dd3f541 100644
--- a/libtransport/src/hicn/transport/utils/log.cc
+++ b/libtransport/src/hicn/transport/utils/log.cc
@@ -42,16 +42,14 @@
* will be provided by Android log. Android log features will be used to output
* log level and tag.
*/
-#ifdef TRANSPORT_LOG_USE_ANDROID_LOG
-#undef TRANSPORT_LOG_USE_ANDROID_LOG
+
#if defined(__ANDROID__)
#define TRANSPORT_LOG_USE_ANDROID_LOG 1
+#define ANDROID_TAG "HicnTransport"
#else
#define TRANSPORT_LOG_USE_ANDROID_LOG 0
#endif
-#else
-#define TRANSPORT_LOG_USE_ANDROID_LOG 0
-#endif
+
/* When defined, NSLog (uses Apple System Log) will be used instead of stderr
* (ignored on non-Apple platforms). Date, time, pid and tid (context) will be
* provided by NSLog. Curiously, doesn't use NSLog() directly, but piggybacks on
@@ -619,7 +617,7 @@ static void out_android_callback(const transport_log_message *const msg,
tag = msg->tag_b;
*msg->tag_e = 0;
}
- __android_log_print(android_lvl(msg->lvl), tag, "%s", msg->msg_b);
+ __android_log_print(android_lvl(msg->lvl), ANDROID_TAG, "%s", msg->msg_b);
}
enum { OUT_ANDROID_MASK = TRANSPORT_LOG_PUT_STD & ~TRANSPORT_LOG_PUT_CTX };