How to use the fabric-shim/lib/logger.js.getLogger function in fabric-shim

To help you get started, we’ve selected a few fabric-shim examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyperledger / fabric-chaincode-node / test / unit / logger.js View on Github external
test('chaincode logger setup tests', (t) => {
	process.env.CORE_CHAINCODE_LOGGING_SHIM = 'critical';
	let log = Logger.getLogger();
	t.equal(log.level, 'fatal', 'Test log level is correctly set for critical');

	process.env.CORE_CHAINCODE_LOGGING_SHIM = 'WARNING';
	log = Logger.getLogger();
	t.equal(log.level, 'warn', 'Test log level is correctly set for warning');
	process.env.CORE_CHAINCODE_LOGGING_SHIM = 'Debug';
	log = Logger.getLogger();
	t.equal(log.level, 'debug', 'Test log level is correctly set for debug');
	process.env.CORE_CHAINCODE_LOGGING_SHIM = 'ERRor';
	log = Logger.getLogger();
	t.equal(log.level, 'error', 'Test log level is correctly set for error');

	delete process.env.CORE_CHAINCODE_LOGGING_SHIM;

	log = Logger.getLogger();
	t.equal(log.level, 'info', 'Test log level is correctly set for error');
github hyperledger / fabric-chaincode-node / test / unit / logger.js View on Github external
let log = Logger.getLogger();
	t.equal(log.level, 'fatal', 'Test log level is correctly set for critical');

	process.env.CORE_CHAINCODE_LOGGING_SHIM = 'WARNING';
	log = Logger.getLogger();
	t.equal(log.level, 'warn', 'Test log level is correctly set for warning');
	process.env.CORE_CHAINCODE_LOGGING_SHIM = 'Debug';
	log = Logger.getLogger();
	t.equal(log.level, 'debug', 'Test log level is correctly set for debug');
	process.env.CORE_CHAINCODE_LOGGING_SHIM = 'ERRor';
	log = Logger.getLogger();
	t.equal(log.level, 'error', 'Test log level is correctly set for error');

	delete process.env.CORE_CHAINCODE_LOGGING_SHIM;

	log = Logger.getLogger();
	t.equal(log.level, 'info', 'Test log level is correctly set for error');

	t.end();
});