0

使用典型DDLog.add(DDOSLogger.sharedInstance, with: .all)代码将 OSLog 输出添加到我的 iOS 应用程序中的 CocoaLumberjack 日志记录。

当我查看在 iOS 模拟器中运行的应用程序的控制台时,我看到了error级别日志记录,但仅此而已(尤其是没有debug级别日志记录)。这是在应用程序的调试版本中,它具有:

#if DEBUG
    dynamicLogLevel = DDLogLevel.debug
#else
    dynamicLogLevel = DDLogLevel.error
#endif

我怀疑这是配置/设置问题,但我无法弄清楚。

另一个线索:os_log("test via os_log")确实出现在控制台应用程序中。

4

1 回答 1

1

默认行为Console.app是隐藏信息/调试消息。

要查看它们,请在中Console.app选择Include Info/Debug MessagesAction Menu

更多信息在这里:https ://github.com/CocoaLumberjack/CocoaLumberjack/issues/1006#issuecomment-451435346 。

于 2020-12-17T02:06:26.037 回答