Logging in console with scripts
The log
object is the standard way to write logs from your script. It ensures logs are properly labeled with the script name and log level, making them easy to debug and track.
Available Logging Methods
log.info(message)
Logs a general information message (light blue in console).
log.info("Script started successfully.");
log.warn(message)
Logs a warning message (orange in console).
log.warn("Something might not be working correctly.");
log.error(message)
Logs an error message (red in console).
log.error("Something went wrong while executing the script.");
Why Use the Embedded Logger?
Logs are tagged with the script name
Colored output for better readability
Easily filter and trace issues per script
Last updated