Skip to content

Commit

Permalink
[fix] add support for es6 Symbol type.
Browse files Browse the repository at this point in the history
- resolves winstonjs#805
  • Loading branch information
tjwebb committed Feb 13, 2016
1 parent 953e1d2 commit eb90196
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/winston/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,14 @@ exports.timestamp = function () {
// logging to non-JSON inputs.
//
exports.serialize = function (obj, key) {
// symbols cannot be directly casted to strings
if (typeof key === 'symbol') {
key = key.toString()
}
if (typeof obj === 'symbol') {
obj = obj.toString()
}

if (obj === null) {
obj = 'null';
}
Expand Down

0 comments on commit eb90196

Please sign in to comment.