@rxap/nest-sentry 11.0.0-dev.8 → 11.0.0
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/CHANGELOG.md +42 -0
- package/package.json +9 -9
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/lib/sentry-app-config.d.ts +2 -1
- package/src/lib/sentry-app-config.js +2 -1
- package/src/lib/sentry-init-hook.d.ts +2 -1
- package/src/lib/sentry-init-hook.js +6 -3
- package/src/lib/sentry-logger.module.d.ts +19 -0
- package/src/lib/{sentry.module.js → sentry-logger.module.js} +19 -12
- package/src/lib/sentry-module-options.factory.d.ts +1 -4
- package/src/lib/sentry-module-options.factory.js +9 -12
- package/src/lib/sentry.interfaces.d.ts +1 -0
- package/src/lib/sentry.logger.js +6 -6
- package/src/lib/sentry.module.d.ts +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,48 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [11.0.0](https://gitlab.com/rxap/packages/compare/@rxap/nest-sentry@11.0.0-dev.16...@rxap/nest-sentry@11.0.0) (2026-01-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @rxap/nest-sentry
|
|
9
|
+
|
|
10
|
+
# [11.0.0-dev.16](https://gitlab.com/rxap/packages/compare/@rxap/nest-sentry@11.0.0-dev.15...@rxap/nest-sentry@11.0.0-dev.16) (2026-01-19)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @rxap/nest-sentry
|
|
13
|
+
|
|
14
|
+
# [11.0.0-dev.15](https://gitlab.com/rxap/packages/compare/@rxap/nest-sentry@11.0.0-dev.14...@rxap/nest-sentry@11.0.0-dev.15) (2026-01-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @rxap/nest-sentry
|
|
17
|
+
|
|
18
|
+
# [11.0.0-dev.14](https://gitlab.com/rxap/packages/compare/@rxap/nest-sentry@11.0.0-dev.13...@rxap/nest-sentry@11.0.0-dev.14) (2025-11-27)
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
- **sentry:** add callback functionality to sentryInitHook ([095cb88](https://gitlab.com/rxap/packages/commit/095cb886de91ba8a179457a3df72b79385ff63ef))
|
|
23
|
+
|
|
24
|
+
# [11.0.0-dev.13](https://gitlab.com/rxap/packages/compare/@rxap/nest-sentry@11.0.0-dev.12...@rxap/nest-sentry@11.0.0-dev.13) (2025-11-21)
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
- **logger:** support custom logger functions in SentryLogger ([97500ac](https://gitlab.com/rxap/packages/commit/97500acab1d17eb7938f56cbbfc7c27d9785b058))
|
|
29
|
+
|
|
30
|
+
# [11.0.0-dev.12](https://gitlab.com/rxap/packages/compare/@rxap/nest-sentry@11.0.0-dev.11...@rxap/nest-sentry@11.0.0-dev.12) (2025-09-18)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @rxap/nest-sentry
|
|
33
|
+
|
|
34
|
+
# [11.0.0-dev.11](https://gitlab.com/rxap/packages/compare/@rxap/nest-sentry@11.0.0-dev.10...@rxap/nest-sentry@11.0.0-dev.11) (2025-09-15)
|
|
35
|
+
|
|
36
|
+
**Note:** Version bump only for package @rxap/nest-sentry
|
|
37
|
+
|
|
38
|
+
# [11.0.0-dev.10](https://gitlab.com/rxap/packages/compare/@rxap/nest-sentry@11.0.0-dev.9...@rxap/nest-sentry@11.0.0-dev.10) (2025-09-15)
|
|
39
|
+
|
|
40
|
+
### Bug Fixes
|
|
41
|
+
|
|
42
|
+
- **sentry:** replace config checks with `sentryOptions.enabled` ([fe790ed](https://gitlab.com/rxap/packages/commit/fe790ed6c725529ef654a18a3f5810990fec4584))
|
|
43
|
+
|
|
44
|
+
# [11.0.0-dev.9](https://gitlab.com/rxap/packages/compare/@rxap/nest-sentry@11.0.0-dev.8...@rxap/nest-sentry@11.0.0-dev.9) (2025-09-08)
|
|
45
|
+
|
|
46
|
+
**Note:** Version bump only for package @rxap/nest-sentry
|
|
47
|
+
|
|
6
48
|
# [11.0.0-dev.8](https://gitlab.com/rxap/packages/compare/@rxap/nest-sentry@11.0.0-dev.7...@rxap/nest-sentry@11.0.0-dev.8) (2025-09-08)
|
|
7
49
|
|
|
8
50
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "11.0.0
|
|
2
|
+
"version": "11.0.0",
|
|
3
3
|
"name": "@rxap/nest-sentry",
|
|
4
4
|
"description": "This package provides a Sentry integration for NestJS applications. It includes a logger, interceptor, and module to simplify error tracking and performance monitoring with Sentry. It offers configurable options for setting up Sentry in your NestJS application.\n",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@nx/devkit": "20.5.0",
|
|
8
|
-
"@rxap/ts-morph": "^1.6.0
|
|
9
|
-
"@rxap/workspace-utilities": "^19.
|
|
8
|
+
"@rxap/ts-morph": "^1.6.0",
|
|
9
|
+
"@rxap/workspace-utilities": "^19.9.0",
|
|
10
10
|
"tslib": "2.6.2"
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"@nestjs/common": "^11.1.1",
|
|
14
14
|
"@nestjs/config": "^4.0.2",
|
|
15
15
|
"@nestjs/core": "^11.1.1",
|
|
16
|
-
"@rxap/nest-logger": "^11.0.0-dev.
|
|
17
|
-
"@rxap/nest-utilities": "^11.0.0-dev.
|
|
16
|
+
"@rxap/nest-logger": "^11.0.0-dev.8",
|
|
17
|
+
"@rxap/nest-utilities": "^11.0.0-dev.8",
|
|
18
18
|
"@sentry/core": "^8.55.0",
|
|
19
19
|
"@sentry/nestjs": "^8.55.0",
|
|
20
20
|
"@sentry/node": "^8.55.0",
|
|
@@ -81,15 +81,15 @@
|
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
"package": "@rxap/nest-logger",
|
|
84
|
-
"version": "11.0.0-dev.
|
|
84
|
+
"version": "11.0.0-dev.8"
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"package": "@rxap/nest-utilities",
|
|
88
|
-
"version": "11.0.0-dev.
|
|
88
|
+
"version": "11.0.0-dev.8"
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
"package": "@rxap/utilities",
|
|
92
|
-
"version": "16.
|
|
92
|
+
"version": "16.5.0-dev.1"
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
"package": "@sentry/core",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
},
|
|
129
129
|
"schematics": "./generators.json",
|
|
130
130
|
"type": "commonjs",
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "36b0e9732b24717840935712e316593ff6aba795",
|
|
132
132
|
"types": "./src/index.d.ts",
|
|
133
133
|
"main": "./src/index.js"
|
|
134
134
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ export * from './lib/determine-sentry-release';
|
|
|
3
3
|
export * from './lib/get-sentry-log-levels';
|
|
4
4
|
export * from './lib/sentry-app-config';
|
|
5
5
|
export * from './lib/sentry-init-hook';
|
|
6
|
+
export * from './lib/sentry-logger.module';
|
|
6
7
|
export * from './lib/sentry-module-options.factory';
|
|
7
8
|
export * from './lib/sentry.interfaces';
|
|
8
9
|
export * from './lib/sentry.logger';
|
|
9
|
-
export * from './lib/sentry.module';
|
|
10
10
|
export * from './lib/tokens';
|
|
11
11
|
export * from './lib/use-sentry-logger-factory';
|
package/src/index.js
CHANGED
|
@@ -7,10 +7,10 @@ tslib_1.__exportStar(require("./lib/determine-sentry-release"), exports);
|
|
|
7
7
|
tslib_1.__exportStar(require("./lib/get-sentry-log-levels"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./lib/sentry-app-config"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./lib/sentry-init-hook"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./lib/sentry-logger.module"), exports);
|
|
10
11
|
tslib_1.__exportStar(require("./lib/sentry-module-options.factory"), exports);
|
|
11
12
|
tslib_1.__exportStar(require("./lib/sentry.interfaces"), exports);
|
|
12
13
|
tslib_1.__exportStar(require("./lib/sentry.logger"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./lib/sentry.module"), exports);
|
|
14
14
|
tslib_1.__exportStar(require("./lib/tokens"), exports);
|
|
15
15
|
tslib_1.__exportStar(require("./lib/use-sentry-logger-factory"), exports);
|
|
16
16
|
// endregion
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Environment } from '@rxap/nest-utilities';
|
|
2
2
|
import { LogSeverityLevel } from '@sentry/core';
|
|
3
3
|
import type { SchemaMap } from 'joi';
|
|
4
|
-
export declare function sentryValidationSchema(environment: Environment, { logLevel }?: Partial<{
|
|
4
|
+
export declare function sentryValidationSchema(environment: Environment, { logLevel, enabled, }?: Partial<{
|
|
5
5
|
logLevel: LogSeverityLevel;
|
|
6
|
+
enabled: boolean;
|
|
6
7
|
}>): SchemaMap;
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sentryValidationSchema = sentryValidationSchema;
|
|
4
4
|
const Joi = require("joi");
|
|
5
|
-
function sentryValidationSchema(environment, { logLevel = 'warn' } = {}) {
|
|
5
|
+
function sentryValidationSchema(environment, { logLevel = 'warn', enabled = environment.sentry?.enabled ?? false, } = {}) {
|
|
6
6
|
const schema = {};
|
|
7
7
|
schema['SENTRY_LOG_LEVEL'] = Joi.string().allow('trace', 'debug', 'info', 'warn', 'error', 'fatal').default(logLevel);
|
|
8
|
+
schema['SENTRY_ENABLED'] = Joi.boolean().default(enabled);
|
|
8
9
|
return schema;
|
|
9
10
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Environment } from '@rxap/nest-utilities';
|
|
2
|
+
import { NodeClient } from '@sentry/node';
|
|
2
3
|
import type { NodeOptions } from '@sentry/node/build/types/types';
|
|
3
|
-
export declare function sentryInitHook(options?: Partial<NodeOptions
|
|
4
|
+
export declare function sentryInitHook<AppOptions = any>(options?: Partial<NodeOptions>, callback?: (client: NodeClient | undefined, options: AppOptions, environment: Environment) => void): (appOptions: any, environment: Environment) => void;
|
|
@@ -5,13 +5,13 @@ const Sentry = require("@sentry/nestjs");
|
|
|
5
5
|
const profiling_node_1 = require("@sentry/profiling-node");
|
|
6
6
|
const determine_sentry_environment_1 = require("./determine-sentry-environment");
|
|
7
7
|
const determine_sentry_release_1 = require("./determine-sentry-release");
|
|
8
|
-
function sentryInitHook(options = {}) {
|
|
9
|
-
return (
|
|
8
|
+
function sentryInitHook(options = {}, callback) {
|
|
9
|
+
return (appOptions, environment) => {
|
|
10
10
|
const dsn = process.env['SENTRY_DSN'] ?? environment.sentry?.dsn;
|
|
11
11
|
if (!dsn) {
|
|
12
12
|
console.warn('No sentry dsn provided.');
|
|
13
13
|
}
|
|
14
|
-
Sentry.init({
|
|
14
|
+
const client = Sentry.init({
|
|
15
15
|
dsn,
|
|
16
16
|
enabled: process.env['SENTRY_ENABLED'] === 'true' ||
|
|
17
17
|
(environment.sentry?.enabled ?? false),
|
|
@@ -31,5 +31,8 @@ function sentryInitHook(options = {}) {
|
|
|
31
31
|
enableLogs: true,
|
|
32
32
|
...options,
|
|
33
33
|
});
|
|
34
|
+
if (callback) {
|
|
35
|
+
callback(client, appOptions, environment);
|
|
36
|
+
}
|
|
34
37
|
};
|
|
35
38
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ConsoleLoggerOptions, DynamicModule } from '@nestjs/common';
|
|
2
|
+
import { FormatMessageFunction, PrintMessagesFunction } from '@rxap/nest-logger';
|
|
3
|
+
import { SentryModuleOptions } from './sentry.interfaces';
|
|
4
|
+
export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<SentryModuleOptions, "register", "create", {
|
|
5
|
+
isGlobal: boolean;
|
|
6
|
+
}>, MODULE_OPTIONS_TOKEN: string | symbol, OPTIONS_TYPE: SentryModuleOptions & Partial<{
|
|
7
|
+
isGlobal: boolean;
|
|
8
|
+
}>, ASYNC_OPTIONS_TYPE: import("@nestjs/common").ConfigurableModuleAsyncOptions<SentryModuleOptions, "create"> & Partial<{
|
|
9
|
+
isGlobal: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
export interface LoggerFunctions {
|
|
12
|
+
printMessagesFunction?: PrintMessagesFunction;
|
|
13
|
+
formatMessageFunction?: FormatMessageFunction;
|
|
14
|
+
}
|
|
15
|
+
export declare class SentryLoggerModule extends ConfigurableModuleClass {
|
|
16
|
+
static register(options: typeof OPTIONS_TYPE, consoleLoggerOptions?: ConsoleLoggerOptions | null, loggerFunctions?: LoggerFunctions | null): DynamicModule;
|
|
17
|
+
static registerAsync(options: typeof ASYNC_OPTIONS_TYPE, consoleLoggerOptions?: ConsoleLoggerOptions | null, loggerFunctions?: LoggerFunctions | null): DynamicModule;
|
|
18
|
+
private static updateProviders;
|
|
19
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.SentryLoggerModule = exports.ASYNC_OPTIONS_TYPE = exports.OPTIONS_TYPE = exports.MODULE_OPTIONS_TOKEN = exports.ConfigurableModuleClass = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const common_1 = require("@nestjs/common");
|
|
7
7
|
const config_1 = require("@nestjs/config");
|
|
@@ -14,14 +14,14 @@ _a = new common_1.ConfigurableModuleBuilder()
|
|
|
14
14
|
isGlobal: true,
|
|
15
15
|
})
|
|
16
16
|
.build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN, exports.OPTIONS_TYPE = _a.OPTIONS_TYPE, exports.ASYNC_OPTIONS_TYPE = _a.ASYNC_OPTIONS_TYPE;
|
|
17
|
-
let
|
|
18
|
-
static register(options,
|
|
19
|
-
return this.updateProviders(super.register(options),
|
|
17
|
+
let SentryLoggerModule = class SentryLoggerModule extends exports.ConfigurableModuleClass {
|
|
18
|
+
static register(options, consoleLoggerOptions = null, loggerFunctions = null) {
|
|
19
|
+
return this.updateProviders(super.register(options), consoleLoggerOptions, loggerFunctions);
|
|
20
20
|
}
|
|
21
|
-
static registerAsync(options,
|
|
22
|
-
return this.updateProviders(super.registerAsync(options),
|
|
21
|
+
static registerAsync(options, consoleLoggerOptions = null, loggerFunctions = null) {
|
|
22
|
+
return this.updateProviders(super.registerAsync(options), consoleLoggerOptions, loggerFunctions);
|
|
23
23
|
}
|
|
24
|
-
static updateProviders(module,
|
|
24
|
+
static updateProviders(module, consoleLoggerOptions, loggerFunctions) {
|
|
25
25
|
module.providers ??= [];
|
|
26
26
|
module.providers.push({
|
|
27
27
|
provide: tokens_1.SENTRY_MODULE_OPTIONS,
|
|
@@ -33,20 +33,27 @@ let SentryModule = class SentryModule extends exports.ConfigurableModuleClass {
|
|
|
33
33
|
timestamp: true,
|
|
34
34
|
logLevels: (0, nest_utilities_1.GetLogLevels)(),
|
|
35
35
|
...options.logger ?? {},
|
|
36
|
+
...consoleLoggerOptions ?? {},
|
|
36
37
|
}),
|
|
37
38
|
inject: [tokens_1.SENTRY_MODULE_OPTIONS],
|
|
38
39
|
});
|
|
39
|
-
if (printMessagesFunction) {
|
|
40
|
+
if (loggerFunctions?.printMessagesFunction) {
|
|
40
41
|
module.providers.push({
|
|
41
42
|
provide: nest_logger_1.RXAP_LOGGER_PRINT_MESSAGES,
|
|
42
|
-
useValue: printMessagesFunction
|
|
43
|
+
useValue: loggerFunctions?.printMessagesFunction
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (loggerFunctions?.formatMessageFunction) {
|
|
47
|
+
module.providers.push({
|
|
48
|
+
provide: nest_logger_1.RXAP_LOGGER_FORMAT_MESSAGE,
|
|
49
|
+
useValue: loggerFunctions?.formatMessageFunction
|
|
43
50
|
});
|
|
44
51
|
}
|
|
45
52
|
return module;
|
|
46
53
|
}
|
|
47
54
|
};
|
|
48
|
-
exports.
|
|
49
|
-
exports.
|
|
55
|
+
exports.SentryLoggerModule = SentryLoggerModule;
|
|
56
|
+
exports.SentryLoggerModule = SentryLoggerModule = tslib_1.__decorate([
|
|
50
57
|
(0, common_1.Global)(),
|
|
51
58
|
(0, common_1.Module)({
|
|
52
59
|
providers: [
|
|
@@ -68,4 +75,4 @@ exports.SentryModule = SentryModule = tslib_1.__decorate([
|
|
|
68
75
|
imports: [],
|
|
69
76
|
exports: [common_1.Logger],
|
|
70
77
|
})
|
|
71
|
-
],
|
|
78
|
+
], SentryLoggerModule);
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { ConfigurableModuleOptionsFactory
|
|
2
|
-
import { ConsoleLoggerOptions } from '@nestjs/common/services/console-logger.service';
|
|
1
|
+
import { ConfigurableModuleOptionsFactory } from '@nestjs/common';
|
|
3
2
|
import { ConfigService } from '@nestjs/config';
|
|
4
3
|
import { SentryModuleOptions } from '@rxap/nest-sentry';
|
|
5
4
|
export declare class SentryModuleOptionsFactory implements ConfigurableModuleOptionsFactory<SentryModuleOptions, 'create'> {
|
|
6
5
|
protected readonly config: ConfigService;
|
|
7
|
-
protected readonly logger: Logger;
|
|
8
|
-
protected readonly options?: ConsoleLoggerOptions;
|
|
9
6
|
create(): Promise<SentryModuleOptions>;
|
|
10
7
|
}
|
|
@@ -4,18 +4,24 @@ exports.SentryModuleOptionsFactory = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const common_1 = require("@nestjs/common");
|
|
6
6
|
const config_1 = require("@nestjs/config");
|
|
7
|
-
const nest_logger_1 = require("@rxap/nest-logger");
|
|
8
7
|
const nest_utilities_1 = require("@rxap/nest-utilities");
|
|
9
8
|
const get_sentry_log_levels_1 = require("./get-sentry-log-levels");
|
|
10
9
|
let SentryModuleOptionsFactory = class SentryModuleOptionsFactory {
|
|
10
|
+
// Do not inject the logger, because it will be created circularly with the SentryModule
|
|
11
|
+
// @Inject(Logger)
|
|
12
|
+
// protected readonly logger!: Logger;
|
|
13
|
+
// Do not inject the logger, because it will be created circularly with the SentryModule
|
|
14
|
+
// @Optional()
|
|
15
|
+
// @Inject(CONSOLE_LOGGER_OPTIONS)
|
|
16
|
+
// protected readonly options?: ConsoleLoggerOptions;
|
|
11
17
|
async create() {
|
|
12
18
|
return {
|
|
13
19
|
logLevels: (0, get_sentry_log_levels_1.GetSentryLogLevels)(this.config.getOrThrow('SENTRY_LOG_LEVEL')),
|
|
14
20
|
logger: {
|
|
15
21
|
timestamp: true,
|
|
16
22
|
logLevels: (0, nest_utilities_1.GetLogLevels)(),
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
},
|
|
24
|
+
enabled: this.config.getOrThrow('SENTRY_ENABLED'),
|
|
19
25
|
};
|
|
20
26
|
}
|
|
21
27
|
};
|
|
@@ -24,15 +30,6 @@ tslib_1.__decorate([
|
|
|
24
30
|
(0, common_1.Inject)(config_1.ConfigService),
|
|
25
31
|
tslib_1.__metadata("design:type", config_1.ConfigService)
|
|
26
32
|
], SentryModuleOptionsFactory.prototype, "config", void 0);
|
|
27
|
-
tslib_1.__decorate([
|
|
28
|
-
(0, common_1.Inject)(common_1.Logger),
|
|
29
|
-
tslib_1.__metadata("design:type", common_1.Logger)
|
|
30
|
-
], SentryModuleOptionsFactory.prototype, "logger", void 0);
|
|
31
|
-
tslib_1.__decorate([
|
|
32
|
-
(0, common_1.Optional)(),
|
|
33
|
-
(0, common_1.Inject)(nest_logger_1.CONSOLE_LOGGER_OPTIONS),
|
|
34
|
-
tslib_1.__metadata("design:type", Object)
|
|
35
|
-
], SentryModuleOptionsFactory.prototype, "options", void 0);
|
|
36
33
|
exports.SentryModuleOptionsFactory = SentryModuleOptionsFactory = tslib_1.__decorate([
|
|
37
34
|
(0, common_1.Injectable)()
|
|
38
35
|
], SentryModuleOptionsFactory);
|
package/src/lib/sentry.logger.js
CHANGED
|
@@ -26,7 +26,7 @@ let SentryLogger = class SentryLogger extends nest_logger_1.RxapLogger {
|
|
|
26
26
|
...optionalParams,
|
|
27
27
|
]);
|
|
28
28
|
super.log(message, ...optionalParams);
|
|
29
|
-
if (!this.
|
|
29
|
+
if (!this.sentryOptions.enabled) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
if (this.sentryOptions.logLevels && !['log', 'info'].some(level => this.sentryOptions.logLevels.includes(level))) {
|
|
@@ -52,7 +52,7 @@ let SentryLogger = class SentryLogger extends nest_logger_1.RxapLogger {
|
|
|
52
52
|
...optionalParams,
|
|
53
53
|
]);
|
|
54
54
|
super.error(message, ...optionalParams);
|
|
55
|
-
if (!this.
|
|
55
|
+
if (!this.sentryOptions.enabled) {
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
if (this.sentryOptions.logLevels && !this.sentryOptions.logLevels.includes('error')) {
|
|
@@ -76,7 +76,7 @@ let SentryLogger = class SentryLogger extends nest_logger_1.RxapLogger {
|
|
|
76
76
|
...optionalParams,
|
|
77
77
|
]);
|
|
78
78
|
super.error(message, ...optionalParams);
|
|
79
|
-
if (!this.
|
|
79
|
+
if (!this.sentryOptions.enabled) {
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
if (this.sentryOptions.logLevels && !this.sentryOptions.logLevels.includes('fatal')) {
|
|
@@ -106,7 +106,7 @@ let SentryLogger = class SentryLogger extends nest_logger_1.RxapLogger {
|
|
|
106
106
|
...optionalParams,
|
|
107
107
|
]);
|
|
108
108
|
super.warn(message, ...optionalParams);
|
|
109
|
-
if (!this.
|
|
109
|
+
if (!this.sentryOptions.enabled) {
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
112
|
if (this.sentryOptions.logLevels && !['warn', 'warning'].some(level => this.sentryOptions.logLevels.includes(level))) {
|
|
@@ -141,7 +141,7 @@ let SentryLogger = class SentryLogger extends nest_logger_1.RxapLogger {
|
|
|
141
141
|
...optionalParams,
|
|
142
142
|
]);
|
|
143
143
|
super.debug(message, ...optionalParams);
|
|
144
|
-
if (!this.
|
|
144
|
+
if (!this.sentryOptions.enabled) {
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
if (this.sentryOptions.logLevels && !this.sentryOptions.logLevels.includes('debug')) {
|
|
@@ -170,7 +170,7 @@ let SentryLogger = class SentryLogger extends nest_logger_1.RxapLogger {
|
|
|
170
170
|
...optionalParams,
|
|
171
171
|
]);
|
|
172
172
|
super.verbose(message, ...optionalParams);
|
|
173
|
-
if (!this.
|
|
173
|
+
if (!this.sentryOptions.enabled) {
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
176
|
if (this.sentryOptions.logLevels && !['verbose', 'trace'].some(level => this.sentryOptions.logLevels.includes(level))) {
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
import { PrintMessagesFunction } from '@rxap/nest-logger';
|
|
3
|
-
import { SentryModuleOptions } from './sentry.interfaces';
|
|
4
|
-
export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<SentryModuleOptions, "register", "create", {
|
|
5
|
-
isGlobal: boolean;
|
|
6
|
-
}>, MODULE_OPTIONS_TOKEN: string | symbol, OPTIONS_TYPE: SentryModuleOptions & Partial<{
|
|
7
|
-
isGlobal: boolean;
|
|
8
|
-
}>, ASYNC_OPTIONS_TYPE: import("@nestjs/common").ConfigurableModuleAsyncOptions<SentryModuleOptions, "create"> & Partial<{
|
|
9
|
-
isGlobal: boolean;
|
|
10
|
-
}>;
|
|
11
|
-
export declare class SentryModule extends ConfigurableModuleClass {
|
|
12
|
-
static register(options: typeof OPTIONS_TYPE, printMessagesFunction?: PrintMessagesFunction | null): DynamicModule;
|
|
13
|
-
static registerAsync(options: typeof ASYNC_OPTIONS_TYPE, printMessagesFunction?: PrintMessagesFunction | null): DynamicModule;
|
|
14
|
-
private static updateProviders;
|
|
15
|
-
}
|