winston-transport-sentry-node
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -42,3 +42,3 @@ "use strict"; | ||
return callback(); | ||
var message = info.message, winstonLevel = info.level, tags = info.tags, meta = tslib_1.__rest(info, ["message", "level", "tags"]); | ||
var message = info.message, winstonLevel = info.level, tags = info.tags, user = info.user, meta = tslib_1.__rest(info, ["message", "level", "tags", "user"]); | ||
var sentryLevel = this.levelsMap[winstonLevel]; | ||
@@ -50,4 +50,5 @@ Sentry.configureScope(function (scope) { | ||
scope.setExtras(meta); | ||
// TODO: add user details | ||
// scope.setUser({ id: '4711' }); // id, email, username, ip_address | ||
if (user !== undefined && _this.isObject(user)) { | ||
scope.setUser(user); | ||
} | ||
// TODO: add fingerprints | ||
@@ -54,0 +55,0 @@ // scope.setFingerprint(['{{ default }}', path]); // fingerprint should be an array |
{ | ||
"name": "winston-transport-sentry-node", | ||
"description": "@sentry/node transport for the winston v3 logger", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"author": "Andrew Avdeev <andrewww.avdeev@gmail.com>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -92,5 +92,11 @@ | ||
Additional properties of `info` are sent as [Sentry Extra Context](https://docs.sentry.io/enriching-error-data/context/?platform=javascript#extra-context). | ||
If `info.user` is an object, it will be sent as [Sentry User](https://docs.sentry.io/platforms/javascript/#capturing-the-user). | ||
```js | ||
logger.error("some error", { user: { username: "somebody", id: "123" } }); | ||
``` | ||
Additional properties of `info` are sent as [Sentry Extra Context](https://docs.sentry.io/enriching-error-data/context/?platform=javascript#extra-context). | ||
```js | ||
logger.error("some error", { whatever: "is sent as extra" }); | ||
@@ -97,0 +103,0 @@ ``` |
@@ -45,3 +45,3 @@ import * as Sentry from '@sentry/node'; | ||
const { message, level: winstonLevel, tags, ...meta } = info; | ||
const { message, level: winstonLevel, tags, user, ...meta } = info; | ||
@@ -57,4 +57,5 @@ const sentryLevel = (this.levelsMap as any)[winstonLevel]; | ||
// TODO: add user details | ||
// scope.setUser({ id: '4711' }); // id, email, username, ip_address | ||
if (user !== undefined && this.isObject(user)) { | ||
scope.setUser(user); | ||
} | ||
@@ -61,0 +62,0 @@ // TODO: add fingerprints |
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
20594
198
146