+

Search Tips   |   Advanced Search

Create log for package

We can create a logger for a specific package.

To avoid writing a package name every time a log message is written, create a logger for a specific package.

var JSONStoreLogger = new WL.Logger.create({pkg: 'wl.jsonstore'});
JSONStoreLogger.info('Hello', 'world.');
//Hello world.
JSONStoreLogger.warn(1,2,3,4);
//1 2 3 4
var AnalyticsLogger = new WL.Logger.create({pkg: 'wl.analytics'});
AnalyticsLogger.error(new Error('BOOM.');
//Error: BOOM.


Parent topic: Configure the MobileFirst Logger