node-logger-easy
Export the log to the console or file, customize the output log format, support sending mail to the designated mailbox;
description
If you want to see more:
- 1. 'git clone git@github.com:dai1254473705/node-logger-easy.git';
- 2. 'npm install'
- 3. 'npm run test'
Installation
`npm install node-logger-easy --save` or `cnpm install node-logger-easy --save` or `yarn add node-logger-easy`
colors
all colors :
- 'black'
- 'red'
- 'green'
- 'yellow'
- 'blue'
- 'magenta'
- 'cyan'
- 'white'
- 'gray'
- 'redBright'
- 'greenBright'
- 'yellowBright'
- 'blueBright'
- 'magentaBright'
- 'cyanBright'
- 'whiteBright'
example
/** * test * index.js */const nodeLoggerEasy = require;const logger = new nodeLoggerEasy
use
logger.trance;logger.debug;logger.info;logger.warn;logger.error;logger.fatal;logger.warn;
- jsonString format
- json format
- string format
- logs file
method
logger[level](message,options);
-
messages:
---logger.info(String);
---logger.info(String,options);
---logger.info(Object);
---logger.info(Object,options);
-
options
{color: 'blue'}
You can specify the log color of the current output,Only show color in terminal;
all levels: ['trance', 'debug', 'info', 'warn', 'error', 'fatal']
- logger.trance
- logger.debug
- logger.info
- logger.warn
- logger.error
- logger.fatal
attention
email Not completed, ongoing updates
License
Copyright (c) 2018-present, Yunzhou Dai