Skip to content

jinweizhiyuan/logger-line-number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logger-line-number

nodejs logger utility with name and linen number

Installation

npm install logger-line-number

Usage

const logger = require('logger-line-number')

logger.log('test')
//2021-02-03 13:28:30 test.js:3:8 [INFO] test

logger.error('error')
2021-02-03 13:28:30 test.js:3:8 [ERROR] error

logger.debug('debug')
//2021-02-03 13:28:30 test.js:3:8 [DEBUG] debug

logger.setLogType(logger.LOG_TYPES.NONE)  //禁用打印日志
logger.setLogType(logger.LOG_TYPES.ERROR)  //打印 错误 日志
logger.setLogType(logger.LOG_TYPES.NORMAL)  //打印 错误 消息 日志
logger.setLogType(logger.LOG_TYPES.DEBUG)  //打印 错误 消息 调试 日志

Test

npm run test

About

logger with filename and line number

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published