Showing Debug and Info Logs in the macOS Sierra Console

This is one of those "it's obvious in hindsight" problems I ran into recently.

At the day job, we have been migrating all of our logging code from Aspen to Apple's new Unified Logging System. This has been a win for the most part: we got to terminate a third-party dependency, while also getting some advanced features such as log filtering based on a category or subsystem.

The problem I ran into last week was trying to debug a background session issue on my iOS device. We use the different logging levels provided by os_log to help keep users logs a bit less chatty than just spitting out print or NSLog statements everywhere. By default, the new Console app in macOS Sierra only shows logs that match the error level (or have no level at all). I needed to see our debug and info log information.

If you watch the WWDC video on the new logging system they show you a few Terminal commands you can run to adjust your logging level on the Mac. It doesn't really show you how to adjust that for an iOS device plugged into your Mac, however.

Long story short, there's no Terminal command. There's two options in the "Action" menu on the Console. Just select "Include Debug Messages" or "Include Info Messages" and you are good to go.

Turn on info and debug messaging in the Sierra Console

I sure felt dumb once I figured that out. You win this round, Apple.

Read more about. . .

By Justin Williams

This is a two sentence bio. There are many like it, but this one is mine.