提交 2937f06a 编写于 作者: C Chris Bracken 提交者: GitHub

Eliminate use of ASL on iOS, --no-redirect-to-syslog flag (#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.
上级 642e325f
......@@ -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",
......
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册