forked from exceptionless/Exceptionless.JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodeExceptionlessClient.ts
More file actions
33 lines (28 loc) · 1.47 KB
/
NodeExceptionlessClient.ts
File metadata and controls
33 lines (28 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import {
Configuration,
ExceptionlessClient
} from "@exceptionless/core";
import { NodeGlobalHandlerPlugin } from "./plugins/NodeGlobalHandlerPlugin.js";
import { NodeLifeCyclePlugin } from "./plugins/NodeLifeCyclePlugin.js";
import { NodeWrapFunctions } from "./plugins/NodeWrapFunctions.js";
import { NodeEnvironmentInfoCollector } from "./services/NodeEnvironmentInfoCollector.js";
import { NodeErrorParser } from "./services/NodeErrorParser.js";
import { NodeRequestInfoCollector } from "./services/NodeRequestInfoCollector.js";
import { NodeFileStorage } from "./storage/NodeFileStorage.js";
import { NodeFetchSubmissionClient } from "./submission/NodeFetchSubmissionClient.js";
export class NodeExceptionlessClient extends ExceptionlessClient {
public async startup(configurationOrApiKey?: (config: Configuration) => void | string): Promise<void> {
const config = this.config;
if (configurationOrApiKey) {
config.services.storage = new NodeFileStorage();
config.services.environmentInfoCollector = new NodeEnvironmentInfoCollector();
config.services.errorParser = new NodeErrorParser();
config.services.requestInfoCollector = new NodeRequestInfoCollector();
config.services.submissionClient = new NodeFetchSubmissionClient(config);
config.addPlugin(new NodeGlobalHandlerPlugin());
config.addPlugin(new NodeLifeCyclePlugin());
config.addPlugin(new NodeWrapFunctions());
}
await super.startup(configurationOrApiKey);
}
}