Loading

  1. Configuration
  2. Logging Examples
  3. TDESCRIBE example

Debug extension

This extension add the following functions to WarpScript:

Configuration

Your custom configurations can be stored in a new etc/conf.d/99-myWarp10.conf file. Your custom configurations will override all the predefined Warp 10 configuration.

// 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 specify 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 the one of the first element in a LIST or a MAP.

{ 'key' [ [ NEWGTS ] ] } TDESCRIBE will return "MAP { STRING : LIST [ LIST [ GTS ] ] } ".