Skip to content

Log

Stats from running flow

It is possible to have extra stats logged from a running flow - these items will get logged when the flow finishes along with timing and other info.

js
// Log "foo" and "bar" values
Log.flowStats = {
  foo: 1200,
  bar: "abc"
};
// or
Log.flowStats.qux = true;

Debug, Info, Warn, Error and Fatal

Inserts a line with the appropriate log level in the log.

Parameters

  • key the key of the message - keep this as a constant
  • text the text to insert

Examples

javascript
Log.debug('watch-this','A bug in the hand is better than 10 on the root');
Log.Info('greeting', 'Hello there');
Log.warn('stay-away','You cant go in there');
Log.error('not-as-planned', 'It did no go according to plan');
Log.fatal('very-wrong', 'We should never get to here. Its bad.');

Set log level

Controls the log verbosity of the application driver.

Parameters

  • level the new log level. Must be one of the following: none, fatal, error, warn, info, debug.
  • options optional additional options
    • useStdOut (defaults to false) boolean value indicating if instrumentation log should go to the application stdout or to manatee log.

Example

javascript
Log.setDriverLogging('info', { useStdOut: true });