colorful-logging
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "colorful-logging", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A simple logging module with pleasing default colors and optional color arguments.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,3 +1,13 @@ | ||
const isNode = require('./isNode'); | ||
module.exports = function processLogLine(value, colorFormatter, bgColorFormatter) { | ||
let output = value; | ||
if (output && typeof output === 'object') { | ||
if (isNode()) { | ||
output = require('util').inspect(value); | ||
} else { | ||
output = JSON.stringify(output, null, 2); | ||
} | ||
} | ||
if (typeof colorFormatter === 'function') { | ||
@@ -4,0 +14,0 @@ output = colorFormatter(output); |
3519
12
86