Overview
Use this command to output information to the log. If the level specified is debug, the output may not be visible if the Debug option is not selected for the pipeline. When the level is set to throw, the pipeline will log an error and stop the pipeline.
Syntax
Prints an output to the log as an information message, warning, or error.
PRINT '...' { LEVEL '< DEBUG | INFO | WARNING | ERROR | THROW >' } ;
The output to log; may contain DataZen functions and pipeline parameters. | |
LEVEL |
The output level to use (debug,info,warning,error,throw); default: info. When throw is specified, the pipeline execution stops with and error. |
Example 1
-- Get data from an RSS Feed SELECT * FROM HTTP [Rss Feed] (GET /econi.xml) APPLY TX (//item); PRINT 'This is a message to print to the log'; PRINT 'This is a message to print to the log as a warning' LEVEL 'warning'; -- This will throw a hard error and stop all processing PRINT 'Unexpected result obtained. Exiting.' LEVEL 'throw';
Example 2
-- Get data from an RSS Feed SELECT * FROM HTTP [Rss Feed] (GET /econi.xml) APPLY TX (//item); APPLY PIPELINE ( -- Print a message along with the current pipeline execution id PRINT 'Current datetime: #utcnow() and execution id: @executionid'; -- empty the current pipeline data set, which will exit this pipeline block APPLY FILTER '1=0'; -- This print operation will not execute as a result of the break_on_empty option PRINT 'This output will not be logged'; ) BREAK_ON_EMPTY;