From cecb41958b11eb9f619dc9122a50c293432b43c4 Mon Sep 17 00:00:00 2001 From: Frederik Seiffert Date: Wed, 8 May 2019 10:52:06 +0200 Subject: [PATCH] Always use syslog for NSLog on Android. As there is no way to access stdout/stderr on Android, and syslog is available and outputs to the system log (accesible using "adb logcat"), this improves the developer experience when developing for Android by enabling NSLog output without having to set the "GSLogSyslog" flag. --- Source/NSLog.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/NSLog.m b/Source/NSLog.m index 35e6fc4f3..f2bc50718 100644 --- a/Source/NSLog.m +++ b/Source/NSLog.m @@ -181,8 +181,10 @@ _NSLog_standard_printf_handler(NSString* message) #else #if defined(HAVE_SYSLOG) +#ifndef __ANDROID__ // always use syslog on Android (no stdout/stderr) if (GSPrivateDefaultsFlag(GSLogSyslog) == YES || write(_NSLogDescriptor, buf, len) != (int)len) +#endif { null_terminated_buf = malloc(sizeof (char) * (len + 1)); strncpy (null_terminated_buf, buf, len);