js-logger
This library provies a JavaScript logger that is similar to the Python logger.
Installation
npm install --save @matrixai/logger
Usage
Hierarchical Loggers
Generate sub-loggers for different domains of a project
import Logger from '@matrixai/js-logger'
const logger = new Logger();
const subLogger = logger.getLogger('scope');
Parents and childs of loggers can be gotten
const subLogger = logger.getChild('scope');
const newLogger = subLogger.getParent();
Message types
Can log 4 different types of messages
logger.debug('output');
logger.info('output');
logger.warn('output');
logger.error('output');
Can set the level of loggers to control the verbosity
logger.setLevel(3);
logger.debug('output');
logger.info('output');
logger.warn('output');
logger.error('output');
Development
Run nix-shell
, and once you're inside, you can use:
npm install
npm run build
npm run ts-node
npm run test
npm run lint
npm run lintfix
Publishing
npm version patch
npm run build
npm publish --access public
git push
git push --tags