Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
e0ebaea5
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e0ebaea5
编写于
2月 12, 2020
作者:
F
Francisco Magdaleno
提交者:
GitHub
2月 12, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Re-land: Use os_log instead of syslog on Apple platforms (#16549)" (#16558)
This reverts commit
6aacf5e7
.
上级
5fb0116d
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
9 addition
and
50 deletion
+9
-50
fml/logging.cc
fml/logging.cc
+3
-33
lib/ui/dart_runtime_hooks.cc
lib/ui/dart_runtime_hooks.cc
+6
-17
未找到文件。
fml/logging.cc
浏览文件 @
e0ebaea5
...
...
@@ -11,8 +11,7 @@
#if defined(OS_ANDROID)
#include <android/log.h>
#elif defined(OS_MACOSX)
#include <os/log.h>
#elif defined(OS_IOS)
#include <syslog.h>
#endif
...
...
@@ -82,37 +81,8 @@ LogMessage::~LogMessage() {
break
;
}
__android_log_write
(
priority
,
"flutter"
,
stream_
.
str
().
c_str
());
#elif defined(OS_MACOSX)
const
char
*
chars
=
stream_
.
str
().
c_str
();
// Unified logging (os_log) became available in iOS 9.0 and syslog stopped
// working in iOS 13.0. idevicesyslog made device syslog available on the
// connected host, but there is no known API to view device unified logging on
// the host. Flutter tool will continue to observe syslog on devices older
// than iOS 13.0 since it provides more logging context, particularly for
// application crashes.
if
(
__builtin_available
(
iOS
13.0
,
macOS
10.11
,
*
))
{
os_log_t
engine_log
=
os_log_create
(
"io.flutter"
,
"engine"
);
switch
(
severity_
)
{
// TODO(flutter/flutter#45931): LogSeverity LOG_INFO and LOG_WARNING
// collide with syslog log level macros.
case
0
/* LOG_INFO */
:
os_log_debug
(
engine_log
,
"%s"
,
chars
);
break
;
case
1
/* LOG_WARNING */
:
case
LOG_ERROR
:
os_log_error
(
engine_log
,
"%s"
,
chars
);
break
;
case
LOG_FATAL
:
os_log_fault
(
engine_log
,
"%s"
,
chars
);
break
;
default:
os_log
(
engine_log
,
"%s"
,
chars
);
break
;
}
}
else
{
syslog
(
LOG_ALERT
,
"%s"
,
chars
);
}
#elif defined(OS_IOS)
syslog
(
LOG_ALERT
,
"%s"
,
stream_
.
str
().
c_str
());
#else
std
::
cerr
<<
stream_
.
str
();
std
::
cerr
.
flush
();
...
...
lib/ui/dart_runtime_hooks.cc
浏览文件 @
e0ebaea5
...
...
@@ -30,8 +30,7 @@
#if defined(OS_ANDROID)
#include <android/log.h>
#elif defined(OS_MACOSX)
#include <os/log.h>
#elif defined(OS_IOS)
extern
"C"
{
// Cannot import the syslog.h header directly because of macro collision.
extern
void
syslog
(
int
,
const
char
*
,
...);
...
...
@@ -200,29 +199,19 @@ void Logger_PrintString(Dart_NativeArguments args) {
// Write to the logcat on Android.
__android_log_print
(
ANDROID_LOG_INFO
,
logger_prefix
.
c_str
(),
"%.*s"
,
(
int
)
length
,
chars
);
#elif defined(OS_MACOSX)
#elif defined(OS_IOS)
// Write to syslog on iOS.
//
// TODO(cbracken): replace with dedicated communication channel and bypass
// iOS logging APIs altogether.
//
// Unified logging (os_log) became available in iOS 9.0 and syslog stopped
// working in iOS 13.0. idevicesyslog made device syslog available on the
// connected host, but there is no known API to view device unified logging
// on the host. Flutter tool will continue to observe syslog on devices
// older than iOS 13.0 since it provides more logging context, particularly
// for application crashes.
if
(
__builtin_available
(
iOS
13.0
,
macOS
10.11
,
*
))
{
os_log_t
dart_log
=
os_log_create
(
"io.flutter"
,
"dart"
);
os_log
(
dart_log
,
"%.*s"
,
static_cast
<
int
>
(
length
),
chars
);
}
else
{
syslog
(
1
/* LOG_ALERT */
,
"%.*s"
,
static_cast
<
int
>
(
length
),
chars
);
}
syslog
(
1
/* LOG_ALERT */
,
"%.*s"
,
(
int
)
length
,
chars
);
#else
std
::
cout
<<
log_string
<<
std
::
endl
;
#endif
}
if
(
dart
::
bin
::
ShouldCaptureStdout
())
{
//
R
eport print output on the Stdout stream.
//
For now we r
eport print output on the Stdout stream.
uint8_t
newline
[]
=
{
'\n'
};
Dart_ServiceSendDataEvent
(
"Stdout"
,
"WriteEvent"
,
reinterpret_cast
<
const
uint8_t
*>
(
chars
),
length
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录