Writing Diagnostic Log Messages from Your Scripts

To write messages to the diagnostic log, use the print or println function. The former writes its value without any newline character, while the latter writes it value along with a newline. For example:

// Write a diagnostic message to the log. Notice how
// convenient string substitution expressions are
println("Status = ${Status}")

In this release, the diagnostic messages in the log are not identified by context, so it can be helpful to include information in the printed diagnostic messages to identify what code was executing when the diagnostic message was written. For example:

// Write a diagnostic message to the log, including info about the context
println("[In: BeforeInsert] Status = ${Status}")