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

Compare with Current View Page History

Version 1 Next »

Logging with the JS7 Logger

A JavaScript Job can use the JS7 Logger like this:

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

	processOrder(js7Step) {
		js7Step.getLogger().info( 'hello world' ); 		
		js7Step.getLogger().warn('.. logging a warning');
		js7Step.getLogger().error('.. logging an error');
		js7Step.getLogger().debug('.. logging 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 Console Logger

A JavaScript Job can use the Console Logger like this:

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

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

        // do some stuff
    }
}

Further Resources


  • No labels