From 0e016eba61b2918feed39bb6eaf2d093f45b9581 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Tue, 11 Feb 2020 10:36:56 +0100 Subject: [HICN-511] Added android log for libhicntransport Change-Id: I566939e02d7f2c8be6be9665d32c09f4737f69e1 Signed-off-by: Mauro Sardara --- libtransport/src/hicn/transport/utils/log.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'libtransport') 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 }; -- cgit 1.2.3-korg