console-format
v2.2.12
Published
format console print
Downloads
7
Readme
console-format
Introduce
This package is a tool can format console output. Origin console method has been stored in window.nativeConsole or global.nativeConsole. The effect like as follows:
console.log('log');
console.info('info');
console.debug('debug');
console.warn('warn');
console.error('error');
[2021-06-03 11:25:07.930] [LOG] [59764][/Users/charm/Documents/projects/console-format/test.js:3] log
[2021-06-03 11:22:07.933] [INFO] [59489][/Users/charm/Documents/projects/console-format/test.js:3] info
[2021-06-03 11:22:07.945] [DEBUG] [59489][/Users/charm/Documents/projects/console-format/test.js:4] debug
[2021-06-03 11:22:07.945] [WARN] [59489][/Users/charm/Documents/projects/console-format/test.js:5] warn
[2021-06-03 11:22:07.947] [ERROR] [59489][/Users/charm/Documents/projects/console-format/test.js:6] error
Usage
npm i console-format
const consoleFormat = require('console-format)
consoleFormat()
console.log("put your log here");
Functions
This tools only format console.log
console.info
, console.warn
and console.error
, other console method still as origin console style.
Origin console has been stored in global.nativeConsole.
To experience magic effect, just run npm run test