You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Logging with the JS7 Logger

JS7 - JavaScript Jobs can use the JS7 Logger like this:

Example for implementation of JS7Job with JavaScript
class JS7Job extends js7.Job {

	processOrder(js7Step) {
		js7Step.getLogger().info('logging some information');
		js7Step.getLogger().warn('.. logging some warning');
		js7Step.getLogger().error('.. logging some error');
		js7Step.getLogger().debug('.. logging some debug output');

		// do some stuff
    }
}


Explanation:

  • The js7Step.getLogger() object is provided that offers related methods for logging.
  • For details see JS7 - Job API.

Logging with the JavaScript Console Logger

JavaScript Jobs can use the Console Logger like this:

Example for implementation of JS7Job with JavaScript
class JS7Job extends js7.Job {

	processOrder(js7Step) {
		console.info('.. logging some information');
        console.log('.. logging some information');
		console.warn('.. logging some warning');
		console.error('.. logging some error');
		console.debug('.. logging some debug output');

        // do some stuff
    }
}

Further Resources


  • No labels