I'm testing code on OS 10.12. My NSLog statements work as expected in XCode however in my release builds they do not write to the Console. My understanding is that NSLog was supposed to be shimmed to os_log.
In order to get around the issue I built a small class which tests the OS version and uses NSLog if < 10.12, otherwise os_log. Once again the messages show up in XCode but do not appear in the console (on 10.12).
I've tested every level of os_log support and even a custom log. All work in Xcode, none with the console when running 'live'. I've tested that the os_log levels are enabled and they seem to be.
The documentation is extremely limited. There is sample code for the iPhone, but I can't find anything for a Mac. The iPhone code seems to be doing pretty much what I'm doing.
I must be missing something basic. Any help would be appreciated.
Surely there must be some methof of getting the messages to persist.
There’s been a whole bunch of change in this space. Frankly, I’m not fully up to speed on it myself, but a good place to start would be the WWDC 2016 Session 721 Unified Logging and Activity Tracing, which points you to the
log
tool, which has a snazzy man page.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"