@wing-uni/logger
v0.0.8
Published
wing uniapp logger
Downloads
226
Readme
@wing-uni/logger
Install
$ npm i @wing-uni/logger
Usage
import UniLogger from '@wing-uni/logger';
const logger = new UniLogger('My_CATEGORY');
logger.fatal('Fatal', { name: 'fatal' }); // √
logger.error('Error', { name: 'error' }); // √
logger.warn('Warn', { name: 'warn' }); // √
logger.info('Info', { name: 'info' }); // √
logger.debug('Debug', { name: 'debug' }); // √
logger.trace('Trace', { name: 'trace' }); // √
import UniLogger, { Level } from '@wing-uni/logger';
const logger = new UniLogger('My_CATEGORY');
UniLogger.globalLevel = Level.Error;
// Only `fatal` and `error` can be output when `globalLevel` set as `Level.Error`.
logger.fatal('Fatal', { name: 'fatal' }); // √
logger.error('Error', { name: 'error' }); // √
logger.warn('Warn', { name: 'warn' }); // ×
logger.info('Info', { name: 'info' }); // ×
logger.debug('Debug', { name: 'debug' }); // ×
logger.trace('Trace', { name: 'trace' }); // ×