Xcode 8-os_log_debug和os_log_info日志未显示在新的Mac控制台上(统一日志记录) [英] Xcode 8 - os_log_debug and os_log_info logs are not displayed on new Mac console (unified logging)
问题描述
我正在尝试在Xcode 8和Objective-C中使用新的统一日志记录.它可以正常工作,但是在新的Mac Console上似乎没有显示debug
和info
类型的日志.其他日志类型(error
,fault
,default
)都正确显示.
I'm trying out the new Unified Logging in Xcode 8 and Objective-C. It works fine, but it seems the logs of type debug
and info
are not shown on the new Mac Console. Other logs types (error
, fault
, default
) are all displayed correctly.
在Xcode 8上,我有:
On Xcode 8 I have:
os_log_t logObject = os_log_create("com.myapps", "testing log");
os_log(logObject, "Default log message."); // Captured and shown correctly
os_log_info(logObject, "Info log message."); // Not shown on Console app
os_log_debug(logObject, "Debug log message."); // Not shown on Console app
os_log_error(logObject, "Error log message."); // Captured and shown correctly
os_log_fault(logObject, "Fault log message."); // Captured and shown correctly
在我发出的终端上:
sudo log config --mode "persist:debug,level:debug" --subsystem com.myapps
这就是我得到的:
关于我想念的东西有什么想法吗?
Any idea about what am I missing?
注意:我的问题在@algal提出问题之前至少7个月被问到,怎么能认为是重复问题?
NB: How can my question be considered duplicate as it was asked at least 7 month before the one of @algal?
推荐答案
信息和调试级别必须通过命令行或安装日志配置文件手动启用.请参阅日志记录文档在调试时自定义日志记录行为部分. >了解详情.
Info and Debug levels have to be manually enabled via the command-line or by installing a logging profile. See section Customizing Logging Behavior While Debugging of the Logging documentation for details.
这篇关于Xcode 8-os_log_debug和os_log_info日志未显示在新的Mac控制台上(统一日志记录)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!