Eliminate use of ASL on iOS, --no-redirect-to-syslog flag (flutter/engine#3479)

ASL is deprecated and replaced by os_log() on iOS. As of iOS 10.3,
calling this function breaks our logging altogether. os_log isn't
available pre-iOS 10.0. Rather than implement version checks and
conditional logic, this change eliminates the existing redirection
altogether. All engine code should be logging via the syslog redirection
implemented in Logger_PrintString in dart_runtime_hooks.cc.

Since stdio redirection is eliminated, we eliminate the flag that
controls whether such redirection is enabled.
This commit is contained in:
Chris Bracken
2017-03-15 13:35:53 -07:00
committed by GitHub
parent 02e781f347
commit d67972d649
2 changed files with 0 additions and 21 deletions

View File

@@ -62,11 +62,6 @@ DEF_SWITCH(NonInteractive,
"non-interactive",
"Make the shell non-interactive. By default, the shell attempts "
"to setup a window and create an OpenGL context.")
DEF_SWITCH(NoRedirectToSyslog,
"no-redirect-to-syslog",
"On iOS: Don't redirect stdout and stderr to syslog by default. "
"This is used by the tools to read device logs. However, this can "
"cause logs to not show up when launched from Xcode.")
DEF_SWITCH(Packages, "packages", "Specify the path to the packages.")
DEF_SWITCH(StartPaused,
"start-paused",

View File

@@ -36,20 +36,6 @@ static void InitializeLogging() {
false); // Tick count
}
static void RedirectIOConnectionsToSyslog() {
#if TARGET_OS_IPHONE
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
FlagForSwitch(Switch::NoRedirectToSyslog))) {
return;
}
asl_log_descriptor(NULL, NULL, ASL_LEVEL_INFO, STDOUT_FILENO,
ASL_LOG_DESCRIPTOR_WRITE);
asl_log_descriptor(NULL, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO,
ASL_LOG_DESCRIPTOR_WRITE);
#endif
}
static void InitializeCommandLine() {
base::mac::ScopedNSAutoreleasePool pool;
base::CommandLine::StringVector vector;
@@ -77,8 +63,6 @@ class EmbedderState {
InitializeCommandLine();
RedirectIOConnectionsToSyslog();
InitializeLogging();
base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();