Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('SentryLogger error msg formatting', function (assert) {
var messages = [];
var sLogger = new SentryLogger({
ravenClient: fakeRavenClient(function () {
messages.push([].slice.call(arguments));
})
});
var logger = new Logger({
transports: [ sLogger ]
});
logger.error('oops');
assert.equal(messages[0][1], 'works-with-winston.js: oops');
assert.end();
});
if (typeof opts === 'function') {
listener = opts;
opts = {};
}
var server;
opts = opts || {};
if (!opts.dsn) {
server = SentryServer(listener);
opts.dsn = server.dsn;
}
var sLogger = new SentryLogger(opts);
var logger = new Logger({
transports: [ sLogger ]
});
logger.destroy = function () {
if (server) {
server.close();
}
};
return logger;
}