log-segment
Advanced tools
Comparing version 1.0.7 to 1.0.8
12
main.js
@@ -100,3 +100,7 @@ 'use strict' | ||
if (typeof value === 'object') { | ||
return `[${label}=${JSON.stringify(value)}]` | ||
try { | ||
return `[${label}=${JSON.stringify(value)}]` | ||
} catch (e) { | ||
return `[${label}=INVALID-JSON]` | ||
} | ||
} else { | ||
@@ -171,3 +175,7 @@ return `[${label}=${value}]` | ||
if (typeof message === 'object') { | ||
message = JSON.stringify(message) | ||
try { | ||
message = JSON.stringify(message) | ||
} catch (e) { | ||
message = 'INVALID-JSON' | ||
} | ||
} else if (typeof message === 'function') { | ||
@@ -174,0 +182,0 @@ message = message() |
{ | ||
"name": "log-segment", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "logger with partition", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
9223
203