@zthun/lumberjacky-sentry 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,32 +1,66 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const lumberjackyLog = require("@zthun/lumberjacky-log");
4
- const _ZLoggerSentry = class _ZLoggerSentry {
5
- /**
6
- * Initializes a new instance of this object.
7
- *
8
- * @param _client -
9
- * The sentry client to log to.
10
- */
11
- constructor(_client) {
12
- this._client = _client;
13
- }
14
- log(entry) {
15
- this._client.captureEvent({
16
- message: entry.message,
17
- level: _ZLoggerSentry.SeverityMap[entry.level],
18
- extra: {
19
- context: entry.context
20
- }
21
- });
22
- }
23
- };
24
- _ZLoggerSentry.SeverityMap = Object.freeze({
25
- [lumberjackyLog.ZLogLevel.CATASTROPHE]: "fatal",
26
- [lumberjackyLog.ZLogLevel.ERROR]: "error",
27
- [lumberjackyLog.ZLogLevel.WARNING]: "warning",
28
- [lumberjackyLog.ZLogLevel.INFO]: "info"
29
- });
30
- let ZLoggerSentry = _ZLoggerSentry;
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const lumberjackyLog = require('@zthun/lumberjacky-log');
6
+
7
+ function _class_call_check(instance, Constructor) {
8
+ if (!(instance instanceof Constructor)) {
9
+ throw new TypeError("Cannot call a class as a function");
10
+ }
11
+ }
12
+ function _defineProperties(target, props) {
13
+ for(var i = 0; i < props.length; i++){
14
+ var descriptor = props[i];
15
+ descriptor.enumerable = descriptor.enumerable || false;
16
+ descriptor.configurable = true;
17
+ if ("value" in descriptor) descriptor.writable = true;
18
+ Object.defineProperty(target, descriptor.key, descriptor);
19
+ }
20
+ }
21
+ function _create_class(Constructor, protoProps, staticProps) {
22
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
23
+ return Constructor;
24
+ }
25
+ function _define_property(obj, key, value) {
26
+ if (key in obj) {
27
+ Object.defineProperty(obj, key, {
28
+ value: value,
29
+ enumerable: true,
30
+ configurable: true,
31
+ writable: true
32
+ });
33
+ } else {
34
+ obj[key] = value;
35
+ }
36
+ return obj;
37
+ }
38
+ /**
39
+ * A logger that logs to sentry (https://sentry.io)
40
+ */ var ZLoggerSentry = /*#__PURE__*/ function() {
41
+ function ZLoggerSentry(_client) {
42
+ _class_call_check(this, ZLoggerSentry);
43
+ _define_property(this, "_client", void 0);
44
+ this._client = _client;
45
+ }
46
+ _create_class(ZLoggerSentry, [
47
+ {
48
+ key: "log",
49
+ value: function log(entry) {
50
+ this._client.captureEvent({
51
+ message: entry.message,
52
+ level: ZLoggerSentry.SeverityMap[entry.level],
53
+ extra: {
54
+ context: entry.context
55
+ }
56
+ });
57
+ }
58
+ }
59
+ ]);
60
+ return ZLoggerSentry;
61
+ }();
62
+ var _obj;
63
+ _define_property(ZLoggerSentry, "SeverityMap", Object.freeze((_obj = {}, _define_property(_obj, lumberjackyLog.ZLogLevel.CATASTROPHE, "fatal"), _define_property(_obj, lumberjackyLog.ZLogLevel.ERROR, "error"), _define_property(_obj, lumberjackyLog.ZLogLevel.WARNING, "warning"), _define_property(_obj, lumberjackyLog.ZLogLevel.INFO, "info"), _obj)));
64
+
31
65
  exports.ZLoggerSentry = ZLoggerSentry;
32
66
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/logger/logger-sentry.mts"],"sourcesContent":["import type { Client, SeverityLevel } from \"@sentry/core\";\nimport type { IZLogEntry, IZLogger } from \"@zthun/lumberjacky-log\";\nimport { ZLogLevel } from \"@zthun/lumberjacky-log\";\n\n/**\n * A logger that logs to sentry (https://sentry.io)\n */\nexport class ZLoggerSentry implements IZLogger {\n private static readonly SeverityMap: Record<ZLogLevel, SeverityLevel> =\n Object.freeze({\n [ZLogLevel.CATASTROPHE]: \"fatal\",\n [ZLogLevel.ERROR]: \"error\",\n [ZLogLevel.WARNING]: \"warning\",\n [ZLogLevel.INFO]: \"info\",\n });\n\n /**\n * Initializes a new instance of this object.\n *\n * @param _client -\n * The sentry client to log to.\n */\n public constructor(private _client: Client) {}\n\n public log(entry: IZLogEntry): void {\n this._client.captureEvent({\n message: entry.message,\n level: ZLoggerSentry.SeverityMap[entry.level],\n extra: {\n context: entry.context,\n },\n });\n }\n}\n"],"names":["ZLogLevel"],"mappings":";;;AAOO,MAAM,iBAAN,MAAM,eAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAetC,YAAoB,SAAiB;AAAjB,SAAA,UAAA;AAAA,EAAA;AAAA,EAEpB,IAAI,OAAyB;AAClC,SAAK,QAAQ,aAAa;AAAA,MACxB,SAAS,MAAM;AAAA,MACf,OAAO,eAAc,YAAY,MAAM,KAAK;AAAA,MAC5C,OAAO;AAAA,QACL,SAAS,MAAM;AAAA,MAAA;AAAA,IACjB,CACD;AAAA,EAAA;AAEL;AAzB0B,eAAA,cACtB,OAAO,OAAO;AAAA,EACZ,CAACA,eAAAA,UAAU,WAAW,GAAG;AAAA,EACzB,CAACA,eAAAA,UAAU,KAAK,GAAG;AAAA,EACnB,CAACA,eAAAA,UAAU,OAAO,GAAG;AAAA,EACrB,CAACA,eAAAA,UAAU,IAAI,GAAG;AAAA,CACnB;AAPE,IAAM,gBAAN;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/logger/logger-sentry.mts"],"sourcesContent":["import type { Client, SeverityLevel } from \"@sentry/core\";\nimport type { IZLogEntry, IZLogger } from \"@zthun/lumberjacky-log\";\nimport { ZLogLevel } from \"@zthun/lumberjacky-log\";\n\n/**\n * A logger that logs to sentry (https://sentry.io)\n */\nexport class ZLoggerSentry implements IZLogger {\n private static readonly SeverityMap: Record<ZLogLevel, SeverityLevel> =\n Object.freeze({\n [ZLogLevel.CATASTROPHE]: \"fatal\",\n [ZLogLevel.ERROR]: \"error\",\n [ZLogLevel.WARNING]: \"warning\",\n [ZLogLevel.INFO]: \"info\",\n });\n\n /**\n * Initializes a new instance of this object.\n *\n * @param _client -\n * The sentry client to log to.\n */\n public constructor(private _client: Client) {}\n\n public log(entry: IZLogEntry): void {\n this._client.captureEvent({\n message: entry.message,\n level: ZLoggerSentry.SeverityMap[entry.level],\n extra: {\n context: entry.context,\n },\n });\n }\n}\n"],"names":["ZLoggerSentry","_client","log","entry","captureEvent","message","level","SeverityMap","extra","context","Object","freeze","ZLogLevel","CATASTROPHE","ERROR","WARNING","INFO"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;IAGO,IAAMA,aAAN,iBAAA,WAAA;AAAMA,IAAAA,SAAAA,aAAAA,CAeQ,OAAuB,EAAA;AAf/BA,QAAAA,iBAAAA,CAAAA,IAAAA,EAAAA,aAAAA,CAAAA;;aAegBC,OAAAA,GAAAA,OAAAA;;AAfhBD,IAAAA,aAAAA,CAAAA,aAAAA,EAAAA;;YAiBJE,GAAAA,EAAAA,KAAAA;AAAP,YAAA,KAAA,EAAA,SAAOA,IAAIC,KAAiB,EAAA;AAC1B,gBAAA,IAAI,CAACF,OAAO,CAACG,YAAY,CAAC;AACxBC,oBAAAA,OAAAA,EAASF,MAAME,OAAO;AACtBC,oBAAAA,KAAAA,EAAON,aAAcO,CAAAA,WAAW,CAACJ,KAAAA,CAAMG,KAAK,CAAC;oBAC7CE,KAAO,EAAA;AACLC,wBAAAA,OAAAA,EAASN,MAAMM;AACjB;AACF,iBAAA,CAAA;AACF;;;AAzBWT,IAAAA,OAAAA,aAAAA;AA0BZ,CAAA;AAxBiB,IAAA,IAAA;AADhB,gBAAA,CADWA,aACaO,EAAAA,aAAAA,EACtBG,MAAOC,CAAAA,MAAM,EAAC,IAAA,GAAA,EAAA,EACZ,gBADY,CAAA,IAAA,EACXC,wBAAUC,CAAAA,WAAW,EAAG,OAAA,CAAA,EACzB,gBAFY,CAAA,IAAA,EAEXD,wBAAUE,CAAAA,KAAK,EAAG,OAAA,CAAA,EACnB,gBAHY,CAAA,IAAA,EAGXF,wBAAUG,CAAAA,OAAO,EAAG,SAAA,CAAA,EACrB,gBAJY,CAAA,IAAA,EAIXH,wBAAUI,CAAAA,IAAI,EAAG,MAJN,CAAA,EAAA,IAAA,EAAA,CAAA;;;;"}
package/dist/index.js CHANGED
@@ -1,32 +1,62 @@
1
- import { ZLogLevel } from "@zthun/lumberjacky-log";
2
- const _ZLoggerSentry = class _ZLoggerSentry {
3
- /**
4
- * Initializes a new instance of this object.
5
- *
6
- * @param _client -
7
- * The sentry client to log to.
8
- */
9
- constructor(_client) {
10
- this._client = _client;
11
- }
12
- log(entry) {
13
- this._client.captureEvent({
14
- message: entry.message,
15
- level: _ZLoggerSentry.SeverityMap[entry.level],
16
- extra: {
17
- context: entry.context
18
- }
19
- });
20
- }
21
- };
22
- _ZLoggerSentry.SeverityMap = Object.freeze({
23
- [ZLogLevel.CATASTROPHE]: "fatal",
24
- [ZLogLevel.ERROR]: "error",
25
- [ZLogLevel.WARNING]: "warning",
26
- [ZLogLevel.INFO]: "info"
27
- });
28
- let ZLoggerSentry = _ZLoggerSentry;
29
- export {
30
- ZLoggerSentry
31
- };
1
+ import { ZLogLevel } from '@zthun/lumberjacky-log';
2
+
3
+ function _class_call_check(instance, Constructor) {
4
+ if (!(instance instanceof Constructor)) {
5
+ throw new TypeError("Cannot call a class as a function");
6
+ }
7
+ }
8
+ function _defineProperties(target, props) {
9
+ for(var i = 0; i < props.length; i++){
10
+ var descriptor = props[i];
11
+ descriptor.enumerable = descriptor.enumerable || false;
12
+ descriptor.configurable = true;
13
+ if ("value" in descriptor) descriptor.writable = true;
14
+ Object.defineProperty(target, descriptor.key, descriptor);
15
+ }
16
+ }
17
+ function _create_class(Constructor, protoProps, staticProps) {
18
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
19
+ return Constructor;
20
+ }
21
+ function _define_property(obj, key, value) {
22
+ if (key in obj) {
23
+ Object.defineProperty(obj, key, {
24
+ value: value,
25
+ enumerable: true,
26
+ configurable: true,
27
+ writable: true
28
+ });
29
+ } else {
30
+ obj[key] = value;
31
+ }
32
+ return obj;
33
+ }
34
+ /**
35
+ * A logger that logs to sentry (https://sentry.io)
36
+ */ var ZLoggerSentry = /*#__PURE__*/ function() {
37
+ function ZLoggerSentry(_client) {
38
+ _class_call_check(this, ZLoggerSentry);
39
+ _define_property(this, "_client", void 0);
40
+ this._client = _client;
41
+ }
42
+ _create_class(ZLoggerSentry, [
43
+ {
44
+ key: "log",
45
+ value: function log(entry) {
46
+ this._client.captureEvent({
47
+ message: entry.message,
48
+ level: ZLoggerSentry.SeverityMap[entry.level],
49
+ extra: {
50
+ context: entry.context
51
+ }
52
+ });
53
+ }
54
+ }
55
+ ]);
56
+ return ZLoggerSentry;
57
+ }();
58
+ var _obj;
59
+ _define_property(ZLoggerSentry, "SeverityMap", Object.freeze((_obj = {}, _define_property(_obj, ZLogLevel.CATASTROPHE, "fatal"), _define_property(_obj, ZLogLevel.ERROR, "error"), _define_property(_obj, ZLogLevel.WARNING, "warning"), _define_property(_obj, ZLogLevel.INFO, "info"), _obj)));
60
+
61
+ export { ZLoggerSentry };
32
62
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/logger/logger-sentry.mts"],"sourcesContent":["import type { Client, SeverityLevel } from \"@sentry/core\";\nimport type { IZLogEntry, IZLogger } from \"@zthun/lumberjacky-log\";\nimport { ZLogLevel } from \"@zthun/lumberjacky-log\";\n\n/**\n * A logger that logs to sentry (https://sentry.io)\n */\nexport class ZLoggerSentry implements IZLogger {\n private static readonly SeverityMap: Record<ZLogLevel, SeverityLevel> =\n Object.freeze({\n [ZLogLevel.CATASTROPHE]: \"fatal\",\n [ZLogLevel.ERROR]: \"error\",\n [ZLogLevel.WARNING]: \"warning\",\n [ZLogLevel.INFO]: \"info\",\n });\n\n /**\n * Initializes a new instance of this object.\n *\n * @param _client -\n * The sentry client to log to.\n */\n public constructor(private _client: Client) {}\n\n public log(entry: IZLogEntry): void {\n this._client.captureEvent({\n message: entry.message,\n level: ZLoggerSentry.SeverityMap[entry.level],\n extra: {\n context: entry.context,\n },\n });\n }\n}\n"],"names":[],"mappings":";AAOO,MAAM,iBAAN,MAAM,eAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAetC,YAAoB,SAAiB;AAAjB,SAAA,UAAA;AAAA,EAAA;AAAA,EAEpB,IAAI,OAAyB;AAClC,SAAK,QAAQ,aAAa;AAAA,MACxB,SAAS,MAAM;AAAA,MACf,OAAO,eAAc,YAAY,MAAM,KAAK;AAAA,MAC5C,OAAO;AAAA,QACL,SAAS,MAAM;AAAA,MAAA;AAAA,IACjB,CACD;AAAA,EAAA;AAEL;AAzB0B,eAAA,cACtB,OAAO,OAAO;AAAA,EACZ,CAAC,UAAU,WAAW,GAAG;AAAA,EACzB,CAAC,UAAU,KAAK,GAAG;AAAA,EACnB,CAAC,UAAU,OAAO,GAAG;AAAA,EACrB,CAAC,UAAU,IAAI,GAAG;AAAA,CACnB;AAPE,IAAM,gBAAN;"}
1
+ {"version":3,"file":"index.js","sources":["../src/logger/logger-sentry.mts"],"sourcesContent":["import type { Client, SeverityLevel } from \"@sentry/core\";\nimport type { IZLogEntry, IZLogger } from \"@zthun/lumberjacky-log\";\nimport { ZLogLevel } from \"@zthun/lumberjacky-log\";\n\n/**\n * A logger that logs to sentry (https://sentry.io)\n */\nexport class ZLoggerSentry implements IZLogger {\n private static readonly SeverityMap: Record<ZLogLevel, SeverityLevel> =\n Object.freeze({\n [ZLogLevel.CATASTROPHE]: \"fatal\",\n [ZLogLevel.ERROR]: \"error\",\n [ZLogLevel.WARNING]: \"warning\",\n [ZLogLevel.INFO]: \"info\",\n });\n\n /**\n * Initializes a new instance of this object.\n *\n * @param _client -\n * The sentry client to log to.\n */\n public constructor(private _client: Client) {}\n\n public log(entry: IZLogEntry): void {\n this._client.captureEvent({\n message: entry.message,\n level: ZLoggerSentry.SeverityMap[entry.level],\n extra: {\n context: entry.context,\n },\n });\n }\n}\n"],"names":["ZLoggerSentry","_client","log","entry","captureEvent","message","level","SeverityMap","extra","context","Object","freeze","ZLogLevel","CATASTROPHE","ERROR","WARNING","INFO"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;IAGO,IAAMA,aAAN,iBAAA,WAAA;AAAMA,IAAAA,SAAAA,aAAAA,CAeQ,OAAuB,EAAA;AAf/BA,QAAAA,iBAAAA,CAAAA,IAAAA,EAAAA,aAAAA,CAAAA;;aAegBC,OAAAA,GAAAA,OAAAA;;AAfhBD,IAAAA,aAAAA,CAAAA,aAAAA,EAAAA;;YAiBJE,GAAAA,EAAAA,KAAAA;AAAP,YAAA,KAAA,EAAA,SAAOA,IAAIC,KAAiB,EAAA;AAC1B,gBAAA,IAAI,CAACF,OAAO,CAACG,YAAY,CAAC;AACxBC,oBAAAA,OAAAA,EAASF,MAAME,OAAO;AACtBC,oBAAAA,KAAAA,EAAON,aAAcO,CAAAA,WAAW,CAACJ,KAAAA,CAAMG,KAAK,CAAC;oBAC7CE,KAAO,EAAA;AACLC,wBAAAA,OAAAA,EAASN,MAAMM;AACjB;AACF,iBAAA,CAAA;AACF;;;AAzBWT,IAAAA,OAAAA,aAAAA;AA0BZ,CAAA;AAxBiB,IAAA,IAAA;AADhB,gBAAA,CADWA,aACaO,EAAAA,aAAAA,EACtBG,MAAOC,CAAAA,MAAM,EAAC,IAAA,GAAA,EAAA,EACZ,gBADY,CAAA,IAAA,EACXC,SAAUC,CAAAA,WAAW,EAAG,OAAA,CAAA,EACzB,gBAFY,CAAA,IAAA,EAEXD,SAAUE,CAAAA,KAAK,EAAG,OAAA,CAAA,EACnB,gBAHY,CAAA,IAAA,EAGXF,SAAUG,CAAAA,OAAO,EAAG,SAAA,CAAA,EACrB,gBAJY,CAAA,IAAA,EAIXH,SAAUI,CAAAA,IAAI,EAAG,MAJN,CAAA,EAAA,IAAA,EAAA,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zthun/lumberjacky-sentry",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "A standard lumberjacky log interface to interact with sentry.",
5
5
  "author": "Anthony Bonta",
6
6
  "license": "MIT",
@@ -31,15 +31,15 @@
31
31
  "access": "public"
32
32
  },
33
33
  "dependencies": {
34
- "@sentry/core": "^9.27.0",
35
- "@zthun/lumberjacky-log": "^3.0.0",
34
+ "@sentry/core": "^9.30.0",
35
+ "@zthun/lumberjacky-log": "^3.0.2",
36
36
  "lodash": "^4.17.21"
37
37
  },
38
38
  "devDependencies": {
39
- "@zthun/janitor-build-config": "^19.1.5",
39
+ "@zthun/janitor-build-config": "^19.2.4",
40
40
  "typescript": "~5.8.3",
41
41
  "vite": "^6.3.5",
42
- "vitest": "^3.2.3",
42
+ "vitest": "^3.2.4",
43
43
  "vitest-mock-extended": "^3.1.0"
44
44
  },
45
45
  "peerDependencies": {
@@ -63,5 +63,5 @@
63
63
  "dist"
64
64
  ],
65
65
  "sideEffects": false,
66
- "gitHead": "e8e2a6fd682560f860727fda1de350659a9af1e5"
66
+ "gitHead": "7982ac7db527ad3d4d6d91c76a742dfa74ff4664"
67
67
  }
@@ -1 +0,0 @@
1
- export {};