react-native-test-adx 0.1.14 → 0.1.15
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/lib/module/sdkVersion.js
CHANGED
|
@@ -54,8 +54,16 @@ function shouldCaptureMessage(input, level, structuredLogsUsed) {
|
|
|
54
54
|
}
|
|
55
55
|
return MESSAGE_FALLBACK_EVENTS.has(input.eventName);
|
|
56
56
|
}
|
|
57
|
+
|
|
58
|
+
/** Sentry Logs + logger.* break Metro in dev; release native builds can use them. */
|
|
57
59
|
function usesStructuredSentryLogs(platform) {
|
|
58
|
-
|
|
60
|
+
if (platform === 'web') {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
return typeof __DEV__ !== 'undefined' && !__DEV__;
|
|
64
|
+
}
|
|
65
|
+
function usesMinimalNativeSentryInit(platform) {
|
|
66
|
+
return platform !== 'web' && (typeof __DEV__ === 'undefined' || __DEV__);
|
|
59
67
|
}
|
|
60
68
|
function emitStructuredLog(sentry, level, eventName, metadata) {
|
|
61
69
|
const loggerFn = sentry.logger?.[level];
|
|
@@ -154,9 +162,8 @@ class AdaxonLoggerService {
|
|
|
154
162
|
}
|
|
155
163
|
} else {
|
|
156
164
|
emitNativeActivityBreadcrumb(sentry, level, input.eventName, metadata);
|
|
157
|
-
deliveredToSentry = true;
|
|
158
165
|
}
|
|
159
|
-
if (
|
|
166
|
+
if (!usesMinimalNativeSentryInit(this.platform) && shouldCaptureMessage(input, level, structuredLogSent) && typeof sentry.captureMessage === 'function') {
|
|
160
167
|
sentry.captureMessage(input.eventName, {
|
|
161
168
|
level: sentryLevel(level, 'message'),
|
|
162
169
|
tags,
|
|
@@ -185,28 +192,35 @@ class AdaxonLoggerService {
|
|
|
185
192
|
if (!dsn?.trim()) {
|
|
186
193
|
return;
|
|
187
194
|
}
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
195
|
+
const environment = testMode ? 'adaxon-sdk-test' : 'adaxon-sdk';
|
|
196
|
+
const trimmedDsn = dsn.trim();
|
|
197
|
+
if (usesMinimalNativeSentryInit(this.platform)) {
|
|
198
|
+
// Dev / Metro: avoid Sentry Logs + default integrations (Metro "unknown module undefined").
|
|
199
|
+
sentry.init({
|
|
200
|
+
dsn: trimmedDsn,
|
|
201
|
+
environment,
|
|
202
|
+
enableLogs: false,
|
|
203
|
+
enableAutoConsoleLogs: false,
|
|
204
|
+
enableNative: false,
|
|
205
|
+
autoInitializeNativeSdk: false,
|
|
206
|
+
defaultIntegrations: false,
|
|
207
|
+
integrations: [],
|
|
208
|
+
tracesSampleRate: 0,
|
|
209
|
+
enableAutoSessionTracking: false,
|
|
210
|
+
sendDefaultPii: false
|
|
211
|
+
});
|
|
212
|
+
} else {
|
|
213
|
+
// Web + release native: structured logs reach Sentry (Logs product / logger API).
|
|
214
|
+
sentry.init({
|
|
215
|
+
dsn: trimmedDsn,
|
|
216
|
+
environment,
|
|
217
|
+
enableLogs: true,
|
|
218
|
+
enableAutoConsoleLogs: false,
|
|
219
|
+
tracesSampleRate: 0,
|
|
220
|
+
enableAutoSessionTracking: false,
|
|
221
|
+
sendDefaultPii: false
|
|
222
|
+
});
|
|
223
|
+
}
|
|
210
224
|
}
|
|
211
225
|
sentry.setTag('adaxon_sdk_version', SDK_VERSION);
|
|
212
226
|
sentry.setTag('adaxon_platform', this.platform);
|
package/package.json
CHANGED