Logging in MobileFirst hybrid applications (JavaScript)

improve this page | report issue

Logging example for hybrid applications (JavaScript)

Outputs to browser's JavaScript console, LogCat, or Xcode console:

var MathUtils = function(){
 var logger = WL.Logger.create({pkg: 'MathUtils'});
  var sum = function(a, b){
  var sum = a + b;
 logger.debug('sum called with args ' + a + ' and ' + b + '. Returning ' + sum);
  return sum;

API calls for specific tasks

Turn log capture on or off:

WL.Logger.config({capture: boolean})

Control capture level (verbosity):

WL.Logger.config({level: string})

Turn automatic log sending on or off:

WL.Logger.config({autoSendLogs: boolean})

Turn automatic configuration retrieval on or off:

WL.Logger.config({autoUpdateConfig: boolean})

Last modified on November 09, 2016