raw-log
Tiny and fast debugging and logging tool.
- Multiple logging levels with different colors.
process._rawDebug()
instead ofconsole.log()
.- Milisecond diff based on
process.hrtime()
. - 100% code coverage.
- Requires Node 6+.
Installation
npm i -S raw-log
Quickstart
RAW_LOG=true node my-module.js
const info error = 'my-module' // => INFO | my-module | +0.11ms | <white> hello world </white> // => ERROR | my-module | +0.71ms | <red> goodbye, cruel world </red>
Levels
- debug: grey; while developing
- info: white; normal behavior
- warn: yellow; incorrect behavior; prints
Error.message
- error: red; something broke; prints
Error.message
Note: Using RAW_LOG=true
enables all levels. If you want to log only specific levels, e.g. critical levels: use RAW_LOG=warn,error
.
License
WTFPL – Do What the F*ck You Want to Public License.
Made with ❤️ by @MarkTiedemann.