I'm trying to use unified logging to log messages and retrieve them from a device for inspection. I created a new
OSLog
instance withlet logDebug = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: " debug")
Then I log messages with
os_log("%@", log: logDebug, type: OSLogType.debug, String(format:message, arguments: formatArgs))
This works fine in the Xcode console. It's supposed to be possible to retrieve these logs from an Xcode device by
- Doing a sysdiagnose (as Apple explains here)
- Transferring the sysdiagnose to a Mac, and then
- Inspecting the log (in
) with Console.app or thesystem_logs.logarchive
command line tool.log
When I do this, none of my logs are shown. No logs with the expected subsystem (bundle ID) are shown.
However, if I examine the log files in
system_logs.logarchive
directly via grep
or vim
, the messages are present. So they're in the logs, but for some reason neither Console.app nor log
will show them. I made sure that Console.app is set to show "all messages" and I haven't entered any search terms.What step am I missing, or what detail needs to be different?