Context

I was looking for the cause of stutter in a macOS game and ran several unified-log searches from zsh: GPU faults, display events, and a background log stream capture. They all came back empty, and I wrongly read that as “no matching entries”.

The insight

zsh has its own builtin called log, which comes from its watch/who feature. So in zsh, log show --predicate … never reaches Apple’s log tool. The builtin fails with log: too many arguments, and 2>/dev/null hides that error, so a failed query looks exactly like an empty result.

The query only worked when another command came first, as in timeout 60 log show …, because that command runs the real binary.

  • In zsh scripts, call /usr/bin/log or command log.
  • Don’t discard stderr on a query whose empty result you will treat as evidence.
Terminal window
/usr/bin/log show --last 10m --predicate 'subsystem == "com.apple.Metal"'
command log stream --level debug

Second trap: log stream output is buffered

log stream > file & writes to the file in blocks, so killing it loses whatever is still buffered. Read the window back afterwards instead:

Terminal window
/usr/bin/log show --start '2026-01-01 10:00:00' --end '2026-01-01 10:05:00' --predicate '…'
Terminal window
launchctl setenv MTL_HUD_ENABLED 1
launchctl setenv MTL_HUD_LOG_ENABLED 1

Metal apps launched after this write a metal-HUD: line every second and Metal Compiling Shader events to the unified log.