Skip to content

Instantly share code, notes, and snippets.

@alfredwesterveld
Created July 12, 2016 11:23
Show Gist options
  • Save alfredwesterveld/1f41edd9e475a011822d0d6fb2341269 to your computer and use it in GitHub Desktop.
Save alfredwesterveld/1f41edd9e475a011822d0d6fb2341269 to your computer and use it in GitHub Desktop.
json logger
'use strict';
const timestamp = 'timestamp: "{{timestamp}}"';
const title = 'title: "{{title}}"';
const file = 'file: "{{file}}"';
const line = 'line:"{{line}}"';
const method = 'method: "{{method}}"';
const message = 'message: "{{message}}"';
const jsonlogger = require('tracer').console({
format: `{${timestamp},${title},${file}, ${line},${method},${message}}`
});
module.exports = jsonlogger;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment