winston-transport-rollbar-3
Advanced tools
Comparing version 3.2.4 to 3.2.5
@@ -31,20 +31,23 @@ | ||
log(info, callback) { | ||
const { level, message } = info; | ||
setImmediate(() => { | ||
this.emit('logged', info); | ||
}); | ||
process.nextTick(() => { | ||
const message = util.format(info.message, ...(info.splat || [])); | ||
const rollbarLevel = level === 'warn' ? 'warning' : level; | ||
const level = info[Symbol.for('level')]; | ||
const message = info.message; | ||
const meta = Object.assign({}, info); | ||
delete meta.level; | ||
delete meta.message; | ||
delete meta.splat; | ||
delete meta[Symbol.for('level')]; | ||
const cb = err => { | ||
if (err) { | ||
this.emit('error', err); | ||
return callback(err); | ||
} | ||
this.emit('logged'); | ||
return callback(null, true); | ||
}; | ||
const logMethod = this.rollbar[rollbarLevel] || this.rollbar.log; | ||
return logMethod.apply(this.rollbar, [message, info, new Error(info.stack), cb]); | ||
}); | ||
if (level === 'error') { | ||
this.rollbar.error(message, meta, callback); | ||
} else if (level === 'warn') { | ||
this.rollbar.warning(message, meta, callback); | ||
} else if (level === 'info') { | ||
this.rollbar.info(message, meta, callback); | ||
} else if (level === 'debug') { | ||
this.rollbar.debug(message, meta, callback); | ||
} | ||
} | ||
@@ -51,0 +54,0 @@ } |
{ | ||
"name": "winston-transport-rollbar-3", | ||
"description": "An updated rollbar transport for winston", | ||
"version": "3.2.4", | ||
"version": "3.2.5", | ||
"author": "Andreas Zoellner", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
5479
46
0