write.braintube.com

🍎 Logs

I read logs for a living, not really but sorta. On macOS I've tried to use the Console tool for viewing logs and it always felt like putting my head head into a firehouse. I know that it's possible to filter in the Console but it never clicked for me. Yesterday I was complaining about this to an Apple Eng. and they said, just use the CLI tool log. This is exactly what I was looking for. It works similar to journalctl or just old school tail -f | grep.

For example, if you are using an app called barriers you can view it's log output as:
log show --process barriers

You can do more complex filtering such as:

log show --predicate '(process=="barriers") && (messageType == error)'

It also works on pid and more. Wish I had found this years ago.

#tech

Discuss...