Skip to content

Commit

Permalink
Used this.staticMeta as parameter instead of using bind.
Browse files Browse the repository at this point in the history
  • Loading branch information
lijsselstein committed Jan 28, 2016
1 parent 6e7eddc commit 44251ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/winston-graylog2.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function getMessageLevel(winstonLevel) {
* @param {Object} meta
* @return {Object}
*/
function prepareMeta(meta) {
function prepareMeta(meta, staticMeta) {
meta = meta || {};

if (meta instanceof Error) {
Expand All @@ -53,7 +53,7 @@ function prepareMeta(meta) {
});
}

meta = _.merge(meta, this.staticMeta);
meta = _.merge(meta, staticMeta);

return meta;
}
Expand Down Expand Up @@ -88,7 +88,7 @@ var Graylog2 = winston.transports.Graylog2 = function(options) {
util.inherits(Graylog2, winston.Transport);

Graylog2.prototype.log = function(level, msg, meta, callback) {
meta = prepareMeta.bind(this)(meta);
meta = prepareMeta(meta, this.staticMeta);
msg = this.prelog(msg);

this.graylog2[getMessageLevel(level)](msg.substring(0, 100), msg, meta);
Expand Down

0 comments on commit 44251ec

Please sign in to comment.