1 | Object.defineProperty(exports, '__esModule', { value: true });
|
2 |
|
3 | const utils = require('@sentry/utils');
|
4 | const hub = require('./hub.js');
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | function initAndBind(
|
16 | clientClass,
|
17 | options,
|
18 | ) {
|
19 | if (options.debug === true) {
|
20 | if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
|
21 | utils.logger.enable();
|
22 | } else {
|
23 |
|
24 |
|
25 | console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');
|
26 | }
|
27 | }
|
28 | const hub$1 = hub.getCurrentHub();
|
29 | const scope = hub$1.getScope();
|
30 | if (scope) {
|
31 | scope.update(options.initialScope);
|
32 | }
|
33 |
|
34 | const client = new clientClass(options);
|
35 | hub$1.bindClient(client);
|
36 | }
|
37 |
|
38 | exports.initAndBind = initAndBind;
|
39 |
|