DDOSLogger.sharedInstance 日志记录似乎只记录控制台应用程序中的错误级别日志记录

DDOSLogger.sharedInstance logging only seems to log error level logging in console app

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

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

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

我怀疑这是一个 configuration/setup 问题,但我一直没弄明白。

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

Console.app 的默认行为是隐藏 info/debug 条消息。

要查看它们,请在 Console.app、select Include Info/Debug Messages 来自 Action Menu

此处有更多信息:https://github.com/CocoaLumberjack/CocoaLumberjack/issues/1006#issuecomment-451435346