@zthun/lumberjacky-sentry 4.0.3 → 4.0.5
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 +31 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -44
- package/dist/index.js.map +1 -1
- package/package.json +8 -9
package/dist/index.cjs
CHANGED
|
@@ -1,50 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const lumberjackyLog = require('@zthun/lumberjacky-log');
|
|
6
|
-
|
|
7
|
-
function _define_property(obj, key, value) {
|
|
8
|
-
if (key in obj) {
|
|
9
|
-
Object.defineProperty(obj, key, {
|
|
10
|
-
value: value,
|
|
11
|
-
enumerable: true,
|
|
12
|
-
configurable: true,
|
|
13
|
-
writable: true
|
|
14
|
-
});
|
|
15
|
-
} else {
|
|
16
|
-
obj[key] = value;
|
|
17
|
-
}
|
|
18
|
-
return obj;
|
|
19
|
-
}
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _zthun_lumberjacky_log = require("@zthun/lumberjacky-log");
|
|
3
|
+
//#region src/logger/logger-sentry.mts
|
|
20
4
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}));
|
|
48
|
-
|
|
5
|
+
* A logger that logs to sentry (https://sentry.io)
|
|
6
|
+
*/ var ZLoggerSentry = class ZLoggerSentry {
|
|
7
|
+
_client;
|
|
8
|
+
static SeverityMap = Object.freeze({
|
|
9
|
+
[_zthun_lumberjacky_log.ZLogLevel.CATASTROPHE]: "fatal",
|
|
10
|
+
[_zthun_lumberjacky_log.ZLogLevel.ERROR]: "error",
|
|
11
|
+
[_zthun_lumberjacky_log.ZLogLevel.WARNING]: "warning",
|
|
12
|
+
[_zthun_lumberjacky_log.ZLogLevel.INFO]: "info"
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Initializes a new instance of this object.
|
|
16
|
+
*
|
|
17
|
+
* @param _client -
|
|
18
|
+
* The sentry client to log to.
|
|
19
|
+
*/ constructor(_client) {
|
|
20
|
+
this._client = _client;
|
|
21
|
+
}
|
|
22
|
+
log(entry) {
|
|
23
|
+
this._client.captureEvent({
|
|
24
|
+
message: entry.message,
|
|
25
|
+
level: ZLoggerSentry.SeverityMap[entry.level],
|
|
26
|
+
extra: { context: entry.context }
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
49
31
|
exports.ZLoggerSentry = ZLoggerSentry;
|
|
50
|
-
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -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"],"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["ZLogLevel","ZLoggerSentry","SeverityMap","Object","freeze","CATASTROPHE","ERROR","WARNING","INFO","_client","log","entry","captureEvent","message","level","extra","context"],"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"],"mappings":";;;;;GAOA,IAAaC,gBAAb,MAAaA,cAAAA;;CACX,OAAwBC,cACtBC,OAAOC,OAAO;GACXJ,uBAAAA,UAAUK,cAAc;GACxBL,uBAAAA,UAAUM,QAAQ;GAClBN,uBAAAA,UAAUO,UAAU;GACpBP,uBAAAA,UAAUQ,OAAO;EACpB,CAAA;;;;;;IAQF,YAAmB,SAAyB;OAAjBC,UAAAA;;CAEpBC,IAAIC,OAAyB;AAClC,OAAKF,QAAQG,aAAa;GACxBC,SAASF,MAAME;GACfC,OAAOb,cAAcC,YAAYS,MAAMG;GACvCC,OAAO,EACLC,SAASL,MAAMK,SACjB;GACF,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,46 +1,32 @@
|
|
|
1
|
-
import { ZLogLevel } from
|
|
2
|
-
|
|
3
|
-
function _define_property(obj, key, value) {
|
|
4
|
-
if (key in obj) {
|
|
5
|
-
Object.defineProperty(obj, key, {
|
|
6
|
-
value: value,
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true
|
|
10
|
-
});
|
|
11
|
-
} else {
|
|
12
|
-
obj[key] = value;
|
|
13
|
-
}
|
|
14
|
-
return obj;
|
|
15
|
-
}
|
|
1
|
+
import { ZLogLevel } from "@zthun/lumberjacky-log";
|
|
2
|
+
//#region src/logger/logger-sentry.mts
|
|
16
3
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}));
|
|
44
|
-
|
|
4
|
+
* A logger that logs to sentry (https://sentry.io)
|
|
5
|
+
*/ var ZLoggerSentry = class ZLoggerSentry {
|
|
6
|
+
_client;
|
|
7
|
+
static SeverityMap = Object.freeze({
|
|
8
|
+
[ZLogLevel.CATASTROPHE]: "fatal",
|
|
9
|
+
[ZLogLevel.ERROR]: "error",
|
|
10
|
+
[ZLogLevel.WARNING]: "warning",
|
|
11
|
+
[ZLogLevel.INFO]: "info"
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Initializes a new instance of this object.
|
|
15
|
+
*
|
|
16
|
+
* @param _client -
|
|
17
|
+
* The sentry client to log to.
|
|
18
|
+
*/ constructor(_client) {
|
|
19
|
+
this._client = _client;
|
|
20
|
+
}
|
|
21
|
+
log(entry) {
|
|
22
|
+
this._client.captureEvent({
|
|
23
|
+
message: entry.message,
|
|
24
|
+
level: ZLoggerSentry.SeverityMap[entry.level],
|
|
25
|
+
extra: { context: entry.context }
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
45
30
|
export { ZLoggerSentry };
|
|
46
|
-
|
|
31
|
+
|
|
32
|
+
//# 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"],"
|
|
1
|
+
{"version":3,"file":"index.js","names":["ZLogLevel","ZLoggerSentry","SeverityMap","Object","freeze","CATASTROPHE","ERROR","WARNING","INFO","_client","log","entry","captureEvent","message","level","extra","context"],"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"],"mappings":";;;;GAOA,IAAaC,gBAAb,MAAaA,cAAAA;;CACX,OAAwBC,cACtBC,OAAOC,OAAO;GACXJ,UAAUK,cAAc;GACxBL,UAAUM,QAAQ;GAClBN,UAAUO,UAAU;GACpBP,UAAUQ,OAAO;EACpB,CAAA;;;;;;IAQF,YAAmB,SAAyB;OAAjBC,UAAAA;;CAEpBC,IAAIC,OAAyB;AAClC,OAAKF,QAAQG,aAAa;GACxBC,SAASF,MAAME;GACfC,OAAOb,cAAcC,YAAYS,MAAMG;GACvCC,OAAO,EACLC,SAASL,MAAMK,SACjB;GACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zthun/lumberjacky-sentry",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"description": "A standard lumberjacky log interface to interact with sentry.",
|
|
5
5
|
"author": "Anthony Bonta",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,16 +31,15 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@sentry/core": "^10.
|
|
35
|
-
"@zthun/lumberjacky-log": "^4.0.
|
|
36
|
-
"lodash": "^4.17.21"
|
|
34
|
+
"@sentry/core": "^10.47.0",
|
|
35
|
+
"@zthun/lumberjacky-log": "^4.0.5"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
|
-
"@zthun/janitor-build-config": "^
|
|
40
|
-
"@zthun/janitor-ts-config": "^
|
|
38
|
+
"@zthun/janitor-build-config": "^20.0.2",
|
|
39
|
+
"@zthun/janitor-ts-config": "^20.0.0",
|
|
41
40
|
"typescript": "~5.9.3",
|
|
42
|
-
"vite": "^
|
|
43
|
-
"vitest": "^4.
|
|
41
|
+
"vite": "^8.0.3",
|
|
42
|
+
"vitest": "^4.1.2",
|
|
44
43
|
"vitest-mock-extended": "^3.1.0"
|
|
45
44
|
},
|
|
46
45
|
"peerDependencies": {
|
|
@@ -64,5 +63,5 @@
|
|
|
64
63
|
"dist"
|
|
65
64
|
],
|
|
66
65
|
"sideEffects": false,
|
|
67
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "04c207e6dcd5a19938bda163d8b9c3bd4d92b87c"
|
|
68
67
|
}
|