1. install package
1 | npm i config |
2. Creat config/default.json
1 | { |
3. Creat log.js
1 | const config = require('config'); |
4. Ceate index.js
1 | const logger = require('./log').getLogger('logtest'); |
5. Run
1 | node index.js |
1 | npm i config |
1 | { |
1 | const config = require('config'); |
1 | const logger = require('./log').getLogger('logtest'); |
1 | node index.js |