【问题标题】:Swift, iOS 14: where to find device logs?Swift、iOS 14:在哪里可以找到设备日志?
【发布时间】:2021-04-05 19:59:07
【问题描述】:

我正在尝试调试我的应用程序,我需要记录一些信息。这是我的代码:

let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "main")
                logger.log("One")
                logger.notice("Two")
                os_log("Three")

但是当我按下 Cmd-Shift-2 -> 查看设备日志 之后,它不会显示任何与我的应用程序相关的日志。我想在某处阅读这些消息 - 我该怎么做?

【问题讨论】:

标签: ios swift ios14


【解决方案1】:

您应该能够使用 macOS console.app 查看您的日志。

其他信息 » 探索 Swift 中的日志记录:https://developer.apple.com/videos/play/wwdc2020/10168/

【讨论】:

    猜你喜欢
    • 2018-02-23
    • 2018-07-02
    • 2018-10-31
    • 2019-11-11
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-03
    相关资源
    最近更新 更多