@trenskow/log

Simple JSON log function.


Keywords
log, json
License
BSD-3-Clause
Install
npm install @trenskow/log@2.0.14

Documentation

@trenskow/log

Usage

Just a simple function which lets you log JSON to the console.

const log = require('@trenskow/log');

await log('info', {
	state: 'running',
	port: process.env.PORT
});

This will output to stdout.

{"time":"2020-01-23T10:16:55.289Z","level":"info","state":"running","port":3000}

Debugging

Use it together with jwalker to get pretty printing while debugging.

node ./index.js | jwalker

License

See LICENSE.