winston-transport-sentry-node
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -11,2 +11,3 @@ import * as Sentry from '@sentry/node'; | ||
log(info: any, callback: () => void): void; | ||
end(...args: any[]): void; | ||
readonly sentry: typeof Sentry; | ||
@@ -13,0 +14,0 @@ private withDefaults; |
@@ -10,3 +10,3 @@ "use strict"; | ||
var _this = _super.call(this, info.message) || this; | ||
_this.name = "Error"; | ||
_this.name = info.name || "Error"; | ||
if (info.stack) { | ||
@@ -72,2 +72,12 @@ _this.stack = info.stack; | ||
}; | ||
SentryTransport.prototype.end = function () { | ||
var _this = this; | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
Sentry.flush().then(function () { | ||
_super.prototype.end.apply(_this, tslib_1.__spread(args)); | ||
}); | ||
}; | ||
Object.defineProperty(SentryTransport.prototype, "sentry", { | ||
@@ -81,3 +91,3 @@ get: function () { | ||
SentryTransport.prototype.withDefaults = function (options) { | ||
return tslib_1.__assign({ dsn: options && options.dsn || process.env.SENTRY_DSN || '', serverName: options && options.serverName || 'winston-transport-sentry-node', environment: options && options.environment || process.env.SENTRY_ENVIRONMENT || process.env.NODE_ENV || 'production', debug: options && options.debug || !!process.env.SENTRY_DEBUG || false, sampleRate: options && options.sampleRate || 1.0, maxBreadcrumbs: options && options.maxBreadcrumbs || 100 }, options); | ||
return tslib_1.__assign(tslib_1.__assign({}, options), { dsn: options && options.dsn || process.env.SENTRY_DSN || '', serverName: options && options.serverName || 'winston-transport-sentry-node', environment: options && options.environment || process.env.SENTRY_ENVIRONMENT || process.env.NODE_ENV || 'production', debug: options && options.debug || !!process.env.SENTRY_DEBUG || false, sampleRate: options && options.sampleRate || 1.0, maxBreadcrumbs: options && options.maxBreadcrumbs || 100 }); | ||
}; | ||
@@ -84,0 +94,0 @@ // private normalizeMessage(msg: any) { |
{ | ||
"name": "winston-transport-sentry-node", | ||
"description": "@sentry/node transport for the winston v3 logger", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"author": "Andrew Avdeev <andrewww.avdeev@gmail.com>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -12,3 +12,3 @@ import * as Sentry from '@sentry/node'; | ||
this.name = "Error"; | ||
this.name = info.name || "Error"; | ||
if (info.stack) { | ||
@@ -86,2 +86,8 @@ this.stack = info.stack; | ||
end(...args: any[]) { | ||
Sentry.flush().then(() => { | ||
super.end(...args) | ||
}) | ||
} | ||
public get sentry() { | ||
@@ -93,2 +99,3 @@ return Sentry; | ||
return { | ||
...options, | ||
dsn: options && options.dsn || process.env.SENTRY_DSN || '', | ||
@@ -99,4 +106,3 @@ serverName: options && options.serverName || 'winston-transport-sentry-node', | ||
sampleRate: options && options.sampleRate || 1.0, | ||
maxBreadcrumbs: options && options.maxBreadcrumbs || 100, | ||
...options | ||
maxBreadcrumbs: options && options.maxBreadcrumbs || 100 | ||
}; | ||
@@ -103,0 +109,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21418
214