Viewing debug level logs from iOS simulator
Unified logging system (aka os_log
)
The unified logging system (aka os_log
) is the recommended way of logging by Apple. It’s pretty easy to create a logger and log messages at different levels:
import SwiftUI |
On macOS, we can view the log messages using the Console app. But the debug
level messages from iOS simulators are not visible even after turning on the Include Info Messages
and Include Debug Messages
in Action
menu of the Console app.
This could be a bug of the simulator, because debug
level messages from iOS devices are not affected in the Console app.
Streaming debug logs from the simulator to Terminal
The workaround is to stream the log from the simulator to Terminal:
# if the simulator is already booted |