Browse the docs

Log message

Writes a line of text into the run's Trace.

Log text

Keyboard Maestro: Log

Details #

Adds a line to the Trace for the run, so you can see what a variable held or which branch a macro took. Nothing else happens: no window, no sound, no file. The text can use variables and expressions.

The step's output is the text. The Trace shows the first 200 characters. The full text is also written to the app's log at the step's level, marked private.

Use Show message or Show notification when you want to see the message while the macro runs.

Parameters #

ParameterTypeRequiredValuesWhat it does
leveltextdebug, info (the default), warning or error. It sets the severity of the line in the app's log, and the Trace note reads log (warning): ... for any level but info. Another value fails the step.
texttextThe text to write. An empty text writes an empty line.

Every step also accepts label, onFailure, timeout and dryRunSafe.

Examples #

Log a value, then show it
Do
  1. Set count to 3
  2. Log “count is {{ count }}”
  3. Show “Logged: count is {{ count }}” for 2 s
Open in Switchboard to try it

Gotchas #

  • In a dry run the step is simulated, so nothing is written unless you set dryRunSafe on it.

  • The line only exists in the Trace of that run. It is not a file you can keep.

See also #

Debugger action, Show message, Throw error