winston
Advanced tools
Comparing version 2.4.1 to 2.4.2
@@ -0,1 +1,13 @@ | ||
## v2.4.2 / 2018-04-20 | ||
### SUPER TROOPERS 2 EDITION | ||
- [#1281] Use `Buffer.alloc` and `Buffer.from`. | ||
- [#1086] clone() cloning prototype's custom methods. | ||
- [#1188] Don't swallow Error message/stack when using formatter. | ||
- Allow support for custom HTTP headers in HTTP transport | ||
- [#1253] Fix 2.x README.md (fixes [#1179]) | ||
- Internal maintenance | ||
- Add .gitignores from 3.x for easier maintenance switching. | ||
- Add `package-lock.json` & `.gitattributes` | ||
## v2.4.1 / 2018-03-09 | ||
@@ -2,0 +14,0 @@ ### NODE@10 EDITION |
@@ -107,14 +107,16 @@ /* | ||
for (var i in obj) { | ||
if (Array.isArray(obj[i])) { | ||
copy[i] = obj[i].slice(0); | ||
} | ||
else if (obj[i] instanceof Buffer) { | ||
if (obj.hasOwnProperty(i)) { | ||
if (Array.isArray(obj[i])) { | ||
copy[i] = obj[i].slice(0); | ||
} | ||
else if (obj[i] instanceof Buffer) { | ||
copy[i] = obj[i].slice(0); | ||
} | ||
else if (typeof obj[i] != 'function') { | ||
copy[i] = obj[i] instanceof Object ? exports.clone(obj[i]) : obj[i]; | ||
} | ||
else if (typeof obj[i] === 'function') { | ||
copy[i] = obj[i]; | ||
} | ||
} | ||
else if (typeof obj[i] != 'function') { | ||
copy[i] = obj[i] instanceof Object ? exports.clone(obj[i]) : obj[i]; | ||
} | ||
else if (typeof obj[i] === 'function') { | ||
copy[i] = obj[i]; | ||
} | ||
} | ||
@@ -223,2 +225,7 @@ | ||
options.meta = meta || options.meta; | ||
if (options.meta instanceof Error) { | ||
// Force converting the Error to an plain object now so it | ||
// will not be messed up by decycle() when cloning options | ||
options.meta = exports.clone(options.meta); | ||
} | ||
return String(options.formatter(exports.clone(options))); | ||
@@ -386,3 +393,3 @@ } | ||
exports.tailFile = function(options, callback) { | ||
var buffer = new Buffer(64 * 1024) | ||
var buffer = Buffer.alloc(64 * 1024) | ||
, decode = new StringDecoder('utf8') | ||
@@ -389,0 +396,0 @@ , stream = new Stream |
@@ -25,2 +25,4 @@ var util = require('util'), | ||
this.agent = options.agent; | ||
this.headers = options.headers || {}; | ||
this.headers['content-type'] = 'application/json'; | ||
@@ -61,3 +63,3 @@ if (!this.port) { | ||
method: 'POST', | ||
headers: { 'Content-Type': 'application/json' }, | ||
headers: this.headers, | ||
agent: this.agent, | ||
@@ -82,3 +84,3 @@ auth: (auth) ? auth.username + ':' + auth.password : '' | ||
req.end(new Buffer(JSON.stringify(options), 'utf8')); | ||
req.end(new Buffer.from(JSON.stringify(options), 'utf8')); | ||
}; | ||
@@ -194,3 +196,3 @@ | ||
options = options || {}; | ||
var self = this, | ||
@@ -197,0 +199,0 @@ stream = new Stream, |
{ | ||
"name": "winston", | ||
"description": "A multi-transport async logging library for Node.js", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"author": "Charlie Robbins <charlie.robbins@gmail.com>", | ||
@@ -6,0 +6,0 @@ "maintainers": [ |
@@ -30,3 +30,3 @@ # winston | ||
* [String interpolation](#string-interpolation) | ||
* [Transports](https://github.com/winstonjs/winston/blob/master/docs/transports.md) | ||
* [Transports](https://github.com/winstonjs/winston/blob/2.4.0/docs/transports.md) | ||
* [Multiple transports of the same type](#multiple-transports-of-the-same-type) | ||
@@ -33,0 +33,0 @@ * [Profiling](#profiling) |
175387
36
3986