node-console-formatter

1.0.4 • Public • Published

NPM version NPM Downloads GitHub stars GitHub license

English Document

安装

npm install node-console-formatter

使用

// 默认配置安装 什么也不用做,会自动替换console
require('node-console-formatter')

// 自定义配置安装
// outputDir: 日志文件输出路径
// onlyMessage: 仅打印消息
require('node-console-formatter')({outputDir: 'logs', onlyMessage: false})

截图

// 仅打印文本
console.debug('This is a debug type log')
console.info('This is a info type log')
console.warn('This is a warn type log')
console.error('This is a error type log')

// 打印对象
const test = {name: 'test', id: 100}
console.debug(test)
console.info(test)
console.warn(test)
console.error(test)

// 多参数打印
console.debug('current time:', new Date())
console.info('current time:', new Date())
console.warn('current time:', new Date())
console.error('current time:', new Date())

Readme

Keywords

none

Package Sidebar

Install

npm i node-console-formatter

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

8.91 kB

Total Files

6

Last publish

Collaborators

  • xiandanin