Debug extension
This extension adds the following functions to WarpScript:
Installation
In a configuration file, usually etc/conf.d/70--extensions.conf
, set:
// LOGMSG, NOLOG, STDERR, STDOUT, TDESCRIBE
warpscript.extension.debug = io.warp10.script.ext.debug.DebugWarpScriptExtension
Logging Examples
messages to standard or error output are logged in
/opt/warp10/logs/warp10.log
Monitor the Warp 10 log file in a terminal: for example:
tail -F /opt/warp10/logs/warp10.log
Then run a WarpScript to log a message:
'this is an error' LOGMSG
STDERR specifies the error output instead of the standard output. You may redirect this output to another file if you customize the start function of warp10-standalone.sh
.
TDESCRIBE example
This function is a recursive TYPEOF, designed to debug complex objects. The depth is limited by Warp 10 recursivity setting, and the type is always one of the first elements in a LIST or a MAP.
{ 'key' [ [ NEWGTS ] ] } TDESCRIBE
will return "MAP { STRING : LIST [ LIST [ GTS ] ] } "
.