This is so simple but: how on earth do I set the level of log messages I see in Console.app, if I am trying to use iOS10's new "Unified Logging & Activity Tracing" API?
In other words, if I have code running on iOS like so:
fileprivate let logger = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "mycategory")
fileprivate func logv(_ s:String) {
os_log("%@",log:logger,type:.info,s)
}
Then what do I need to do to see the logged messages in Console.app? By default, only log messages of type .error
seem to show up.
I am wondering how to do this if I am running code on a device, not in the simulator.
Related:
Xcode 8 - os_log_debug and os_log_info logs are not displayed on new Mac console (unified logging)
Double-click the name of the device that you are running the log file on. Click Console (from the window's main menu). The activity log displays on screen.
Enhanced Logging encrypts the logs for safe transport to the support Admin. NOTE: This feature is for troubleshooting, and is disabled by default.
VMware introduced the idea of enhanced logging as a new vSphere security feature. It's aimed to address these traditional log file shortcomings. VMware now handles vCenter events through syslog data which adds actionable details to the log entry without the need for verbose content.
The unified logging system provides a comprehensive and performant API to capture telemetry across all levels of the system. This system centralizes the storage of log data in memory and on disk, rather than writing that data to a text-based log file.
Hilariously, the answer is that you just go to the Console.app's menu bar and select:
Xcode 10.0 beta 6 (likely others too) won’t show debug messages logged from the simulator even after enabling Include Info Messages, Include Debug Messages in the Console.app. AFAIK there is no fix for this.
To see debug logs sent from the simulator you have to stream from a terminal instead:
xcrun simctl spawn booted log stream --debug --predicate 'subsystem == "es.com.jano.Myapp"'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With