It’s not often I get to use a tweet by Many Tricks own Peter Maurer as the inspiration for a tip. But this tip is such a case, as he recently complained about Console and its inability to see old output. A response from @fzwob taught me something I didn’t know:
@petermaurer for logs from customers of your app on Sierra, use Terminal:
log show —predicate ‘processImagePath CONTAINS[c] “processname”’
— Friedrich Markgraf (@fzwob) March 25, 2017
That command browses the captured macOS log data and pulls out anything that matches the specified process name. This could be useful if you’re having troubles with an app and wonder if anything was logged relative to your troubles. Or you might be asked to send the log data if you’re working with the developer on your issue.
Unfortunately, the quotes and dashes in the command as tweeted have been prettified (by Twitter?); here it is in raw Terminal form, using our own Moom as an example:
log show --predicate 'processImagePath CONTAINS[c] "Moom"'
When you press Return, the command will start digging into the log file, and soon start spewing output—possibly a lot of output—to your screen.