@zthun/lumberjacky-sentry 3.0.7 → 4.0.1

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
@@ -4,24 +4,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
5
  const lumberjackyLog = require('@zthun/lumberjacky-log');
6
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
7
  function _define_property(obj, key, value) {
26
8
  if (key in obj) {
27
9
  Object.defineProperty(obj, key, {
@@ -37,30 +19,32 @@ function _define_property(obj, key, value) {
37
19
  }
38
20
  /**
39
21
  * A logger that logs to sentry (https://sentry.io)
40
- */ var ZLoggerSentry = /*#__PURE__*/ function() {
41
- function ZLoggerSentry(_client) {
42
- _class_call_check(this, ZLoggerSentry);
22
+ */ class ZLoggerSentry {
23
+ log(entry) {
24
+ this._client.captureEvent({
25
+ message: entry.message,
26
+ level: ZLoggerSentry.SeverityMap[entry.level],
27
+ extra: {
28
+ context: entry.context
29
+ }
30
+ });
31
+ }
32
+ /**
33
+ * Initializes a new instance of this object.
34
+ *
35
+ * @param _client -
36
+ * The sentry client to log to.
37
+ */ constructor(_client){
43
38
  _define_property(this, "_client", void 0);
44
39
  this._client = _client;
45
40
  }
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)));
41
+ }
42
+ _define_property(ZLoggerSentry, "SeverityMap", Object.freeze({
43
+ [lumberjackyLog.ZLogLevel.CATASTROPHE]: "fatal",
44
+ [lumberjackyLog.ZLogLevel.ERROR]: "error",
45
+ [lumberjackyLog.ZLogLevel.WARNING]: "warning",
46
+ [lumberjackyLog.ZLogLevel.INFO]: "info"
47
+ }));
64
48
 
65
49
  exports.ZLoggerSentry = ZLoggerSentry;
66
50
  //# 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":["ZLoggerSentry","_client","log","entry","captureEvent","message","level","SeverityMap","extra","context","Object","freeze","ZLogLevel","CATASTROPHE","ERROR","WARNING","INFO"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;IAGO,IAAMA,aAAAA,iBAAN,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,aApBAA,CAoBcO,WAAW,CAACJ,KAAAA,CAAMG,KAAK,CAAC;oBAC7CE,KAAAA,EAAO;AACLC,wBAAAA,OAAAA,EAASN,MAAMM;AACjB;AACF,iBAAA,CAAA;AACF,YAAA;;;AAzBWT,IAAAA,OAAAA,aAAAA;AA0BZ,CAAA;AAxBiB,IAAA,IAAA;AADhB,gBAAA,CADWA,aAAAA,EACaO,aAAAA,EACtBG,MAAAA,CAAOC,MAAM,EAAC,IAAA,GAAA,EAAA,EACZ,gBAAA,CADY,IAAA,EACXC,wBAAAA,CAAUC,WAAW,EAAG,OAAA,CAAA,EACzB,gBAAA,CAFY,IAAA,EAEXD,wBAAAA,CAAUE,KAAK,EAAG,OAAA,CAAA,EACnB,gBAAA,CAHY,IAAA,EAGXF,wBAAAA,CAAUG,OAAO,EAAG,SAAA,CAAA,EACrB,gBAAA,CAJY,IAAA,EAIXH,wBAAAA,CAAUI,IAAI,EAAG,MAAA,CAAA,EAJN,IAAA,EAAA,CAAA;;;;"}
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","log","entry","_client","captureEvent","message","level","SeverityMap","extra","context","Object","freeze","ZLogLevel","CATASTROPHE","ERROR","WARNING","INFO"],"mappings":";;;;;;;;;;;;;;;;;;;AAIA;;AAEC,IACM,MAAMA,aAAAA,CAAAA;AAiBJC,IAAAA,GAAAA,CAAIC,KAAiB,EAAQ;AAClC,QAAA,IAAI,CAACC,OAAO,CAACC,YAAY,CAAC;AACxBC,YAAAA,OAAAA,EAASH,MAAMG,OAAO;AACtBC,YAAAA,KAAAA,EAAON,aAAAA,CAAcO,WAAW,CAACL,KAAAA,CAAMI,KAAK,CAAC;YAC7CE,KAAAA,EAAO;AACLC,gBAAAA,OAAAA,EAASP,MAAMO;AACjB;AACF,SAAA,CAAA;AACF,IAAA;AAhBA;;;;;MAMA,WAAA,CAAmB,OAAuB,CAAE;;aAAjBN,OAAAA,GAAAA,OAAAA;AAAkB,IAAA;AAW/C;AAzBE,gBAAA,CADWH,aAAAA,EACaO,aAAAA,EACtBG,MAAAA,CAAOC,MAAM,CAAC;IACZ,CAACC,wBAAAA,CAAUC,WAAW,GAAG,OAAA;IACzB,CAACD,wBAAAA,CAAUE,KAAK,GAAG,OAAA;IACnB,CAACF,wBAAAA,CAAUG,OAAO,GAAG,SAAA;IACrB,CAACH,wBAAAA,CAAUI,IAAI,GAAG;AACpB,CAAA,CAAA,CAAA;;;;"}
package/dist/index.js CHANGED
@@ -1,23 +1,5 @@
1
1
  import { ZLogLevel } from '@zthun/lumberjacky-log';
2
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
3
  function _define_property(obj, key, value) {
22
4
  if (key in obj) {
23
5
  Object.defineProperty(obj, key, {
@@ -33,30 +15,32 @@ function _define_property(obj, key, value) {
33
15
  }
34
16
  /**
35
17
  * A logger that logs to sentry (https://sentry.io)
36
- */ var ZLoggerSentry = /*#__PURE__*/ function() {
37
- function ZLoggerSentry(_client) {
38
- _class_call_check(this, ZLoggerSentry);
18
+ */ class ZLoggerSentry {
19
+ log(entry) {
20
+ this._client.captureEvent({
21
+ message: entry.message,
22
+ level: ZLoggerSentry.SeverityMap[entry.level],
23
+ extra: {
24
+ context: entry.context
25
+ }
26
+ });
27
+ }
28
+ /**
29
+ * Initializes a new instance of this object.
30
+ *
31
+ * @param _client -
32
+ * The sentry client to log to.
33
+ */ constructor(_client){
39
34
  _define_property(this, "_client", void 0);
40
35
  this._client = _client;
41
36
  }
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)));
37
+ }
38
+ _define_property(ZLoggerSentry, "SeverityMap", Object.freeze({
39
+ [ZLogLevel.CATASTROPHE]: "fatal",
40
+ [ZLogLevel.ERROR]: "error",
41
+ [ZLogLevel.WARNING]: "warning",
42
+ [ZLogLevel.INFO]: "info"
43
+ }));
60
44
 
61
45
  export { ZLoggerSentry };
62
46
  //# 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":["ZLoggerSentry","_client","log","entry","captureEvent","message","level","SeverityMap","extra","context","Object","freeze","ZLogLevel","CATASTROPHE","ERROR","WARNING","INFO"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;IAGO,IAAMA,aAAAA,iBAAN,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,aApBAA,CAoBcO,WAAW,CAACJ,KAAAA,CAAMG,KAAK,CAAC;oBAC7CE,KAAAA,EAAO;AACLC,wBAAAA,OAAAA,EAASN,MAAMM;AACjB;AACF,iBAAA,CAAA;AACF,YAAA;;;AAzBWT,IAAAA,OAAAA,aAAAA;AA0BZ,CAAA;AAxBiB,IAAA,IAAA;AADhB,gBAAA,CADWA,aAAAA,EACaO,aAAAA,EACtBG,MAAAA,CAAOC,MAAM,EAAC,IAAA,GAAA,EAAA,EACZ,gBAAA,CADY,IAAA,EACXC,SAAAA,CAAUC,WAAW,EAAG,OAAA,CAAA,EACzB,gBAAA,CAFY,IAAA,EAEXD,SAAAA,CAAUE,KAAK,EAAG,OAAA,CAAA,EACnB,gBAAA,CAHY,IAAA,EAGXF,SAAAA,CAAUG,OAAO,EAAG,SAAA,CAAA,EACrB,gBAAA,CAJY,IAAA,EAIXH,SAAAA,CAAUI,IAAI,EAAG,MAAA,CAAA,EAJN,IAAA,EAAA,CAAA;;;;"}
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","log","entry","_client","captureEvent","message","level","SeverityMap","extra","context","Object","freeze","ZLogLevel","CATASTROPHE","ERROR","WARNING","INFO"],"mappings":";;;;;;;;;;;;;;;AAIA;;AAEC,IACM,MAAMA,aAAAA,CAAAA;AAiBJC,IAAAA,GAAAA,CAAIC,KAAiB,EAAQ;AAClC,QAAA,IAAI,CAACC,OAAO,CAACC,YAAY,CAAC;AACxBC,YAAAA,OAAAA,EAASH,MAAMG,OAAO;AACtBC,YAAAA,KAAAA,EAAON,aAAAA,CAAcO,WAAW,CAACL,KAAAA,CAAMI,KAAK,CAAC;YAC7CE,KAAAA,EAAO;AACLC,gBAAAA,OAAAA,EAASP,MAAMO;AACjB;AACF,SAAA,CAAA;AACF,IAAA;AAhBA;;;;;MAMA,WAAA,CAAmB,OAAuB,CAAE;;aAAjBN,OAAAA,GAAAA,OAAAA;AAAkB,IAAA;AAW/C;AAzBE,gBAAA,CADWH,aAAAA,EACaO,aAAAA,EACtBG,MAAAA,CAAOC,MAAM,CAAC;IACZ,CAACC,SAAAA,CAAUC,WAAW,GAAG,OAAA;IACzB,CAACD,SAAAA,CAAUE,KAAK,GAAG,OAAA;IACnB,CAACF,SAAAA,CAAUG,OAAO,GAAG,SAAA;IACrB,CAACH,SAAAA,CAAUI,IAAI,GAAG;AACpB,CAAA,CAAA,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zthun/lumberjacky-sentry",
3
- "version": "3.0.7",
3
+ "version": "4.0.1",
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": "^10.20.0",
35
- "@zthun/lumberjacky-log": "^3.0.7",
34
+ "@sentry/core": "^10.22.0",
35
+ "@zthun/lumberjacky-log": "^4.0.1",
36
36
  "lodash": "^4.17.21"
37
37
  },
38
38
  "devDependencies": {
39
- "@zthun/janitor-build-config": "^19.3.6",
39
+ "@zthun/janitor-build-config": "^19.4.2",
40
40
  "typescript": "~5.9.3",
41
- "vite": "^7.1.10",
42
- "vitest": "^3.2.4",
41
+ "vite": "^7.1.12",
42
+ "vitest": "^4.0.5",
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": "6c6f6bd6c130e5e5d9c0b09064431f11a52da732"
66
+ "gitHead": "8134db3f67853367ce0412d0e0179dc723c5bc67"
67
67
  }