mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Merge pull request #149 from triplef/android-nslog-syslog-2
Improve NSLog output on Android.
This commit is contained in:
commit
6f8a641bd6
3 changed files with 11 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
|||
2020-07-08 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSLog.m,
|
||||
* Source/NSProcessInfo.m: Improve NSLog output on Android.
|
||||
We now always set -GSLogSyslog, as stdout/stderr is not available on
|
||||
Android. Also fixes log output containing extraneous date/time.
|
||||
|
||||
2020-07-06 Frederik Seiffert <frederik@algoriddim.com>
|
||||
|
||||
* Source/NSThread.m: Fix possible deadlock when becoming multi-
|
||||
|
|
|
@ -181,10 +181,8 @@ _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);
|
||||
|
|
|
@ -1602,7 +1602,10 @@ GSInitializeProcessAndroid(JNIEnv *env, jobject context)
|
|||
// initialize process
|
||||
[procLock lock];
|
||||
fallbackInitialisation = YES;
|
||||
char *argv[] = { arg0 };
|
||||
char *argv[] = {
|
||||
arg0,
|
||||
"-GSLogSyslog", "YES" // use syslog (available via logcat) instead of stdout/stderr (not available on Android)
|
||||
};
|
||||
_gnu_process_args(sizeof(argv)/sizeof(char *), argv, NULL);
|
||||
[procLock unlock];
|
||||
|
||||
|
|
Loading…
Reference in a new issue