pino-sentry
Advanced tools
Comparing version 0.9.0 to 0.10.0
@@ -110,28 +110,28 @@ "use strict"; | ||
const stack = chunk[this.stackAttributeKey] || ''; | ||
Sentry.withScope(scope => { | ||
if (this.isObject(tags)) { | ||
Object.keys(tags).forEach(tag => scope.setTag(tag, tags[tag])); | ||
} | ||
if (this.isObject(extra)) { | ||
Object.keys(extra).forEach(ext => scope.setExtra(ext, extra[ext])); | ||
} | ||
if (this.isObject(breadcrumbs)) { | ||
Object.values(breadcrumbs).forEach(breadcrumb => scope.addBreadcrumb(breadcrumb)); | ||
} | ||
// Capturing Errors / Exceptions | ||
if (this.isSentryException(severity)) { | ||
const error = message instanceof Error ? message : new ExtendedError({ message, stack }); | ||
setImmediate(() => { | ||
Sentry.captureException(error); | ||
cb(); | ||
}); | ||
} | ||
else { | ||
// Capturing Messages | ||
setImmediate(() => { | ||
Sentry.captureMessage(message, severity); | ||
cb(); | ||
}); | ||
} | ||
}); | ||
const scope = new Sentry.Scope(); | ||
scope.setLevel(severity); | ||
if (this.isObject(tags)) { | ||
Object.keys(tags).forEach(tag => scope.setTag(tag, tags[tag])); | ||
} | ||
if (this.isObject(extra)) { | ||
Object.keys(extra).forEach(ext => scope.setExtra(ext, extra[ext])); | ||
} | ||
if (this.isObject(breadcrumbs)) { | ||
Object.values(breadcrumbs).forEach(breadcrumb => scope.addBreadcrumb(breadcrumb)); | ||
} | ||
// Capturing Errors / Exceptions | ||
if (this.isSentryException(severity)) { | ||
const error = message instanceof Error ? message : new ExtendedError({ message, stack }); | ||
setImmediate(() => { | ||
Sentry.captureException(error, scope); | ||
cb(); | ||
}); | ||
} | ||
else { | ||
// Capturing Messages | ||
setImmediate(() => { | ||
Sentry.captureMessage(message, scope); | ||
cb(); | ||
}); | ||
} | ||
} | ||
@@ -138,0 +138,0 @@ validateOptions(options) { |
{ | ||
"name": "pino-sentry", | ||
"description": "@sentry/node transport for pino logger", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"author": "Andrew Avdeev <andrewww.avdeev@gmail.com>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
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
34180