@logbrew/react-native 0.1.24 → 0.1.25
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.
|
@@ -185,7 +185,7 @@ final class AndroidNativeDiagnostics {
|
|
|
185
185
|
nextId("java"),
|
|
186
186
|
System.currentTimeMillis(),
|
|
187
187
|
"Native application crash",
|
|
188
|
-
"
|
|
188
|
+
"critical",
|
|
189
189
|
safeSymbol(error == null ? null : error.getClass().getName(), 256, "AndroidJavaCrash"),
|
|
190
190
|
"uncaught_exception",
|
|
191
191
|
0,
|
|
@@ -221,7 +221,7 @@ final class AndroidNativeDiagnostics {
|
|
|
221
221
|
record.id,
|
|
222
222
|
record.timestampMs,
|
|
223
223
|
"Native application crash",
|
|
224
|
-
"
|
|
224
|
+
"critical",
|
|
225
225
|
"AndroidNativeCrash",
|
|
226
226
|
"signal",
|
|
227
227
|
0,
|
|
@@ -244,8 +244,15 @@ final class AndroidNativeDiagnostics {
|
|
|
244
244
|
output.append("{\"type\":\"issue\",\"id\":\"").append(id)
|
|
245
245
|
.append("\",\"timestamp\":\"").append(timestamp(timestampMs))
|
|
246
246
|
.append("\",\"attributes\":{\"title\":\"").append(title)
|
|
247
|
-
.append("\",\"level\":\"").append(level)
|
|
248
|
-
|
|
247
|
+
.append("\",\"level\":\"").append(level).append('"');
|
|
248
|
+
appendJavaFrames(output, frames);
|
|
249
|
+
if (nativeFrame != null) {
|
|
250
|
+
output.append(",\"nativeStackFrames\":[{\"imageUuid\":\"")
|
|
251
|
+
.append(nativeFrame.imageUuid).append("\",\"architecture\":\"")
|
|
252
|
+
.append(nativeFrame.architecture).append("\",\"instructionOffset\":\"")
|
|
253
|
+
.append(nativeFrame.instructionOffset).append("\"}]");
|
|
254
|
+
}
|
|
255
|
+
output.append(",\"exception\":{\"type\":\"").append(exceptionType)
|
|
249
256
|
.append("\",\"mechanism\":{\"type\":\"").append(mechanism)
|
|
250
257
|
.append("\",\"handled\":false}},\"metadata\":{")
|
|
251
258
|
.append("\"crash.mechanism\":\"").append(mechanism)
|
|
@@ -262,17 +269,11 @@ final class AndroidNativeDiagnostics {
|
|
|
262
269
|
}
|
|
263
270
|
output.append('}');
|
|
264
271
|
appendContext(output, eventConfiguration);
|
|
265
|
-
appendJavaFrames(output, frames);
|
|
266
|
-
if (nativeFrame != null) {
|
|
267
|
-
output.append(",\"nativeStackFrames\":[{\"imageUuid\":\"")
|
|
268
|
-
.append(nativeFrame.imageUuid).append("\",\"architecture\":\"")
|
|
269
|
-
.append(nativeFrame.architecture).append("\",\"instructionOffset\":\"")
|
|
270
|
-
.append(nativeFrame.instructionOffset).append("\"}]");
|
|
271
|
-
}
|
|
272
272
|
return output.append("}}").toString();
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
private static void appendJavaFrames(StringBuilder output, StackTraceElement[] frames) {
|
|
276
|
+
int start = output.length();
|
|
276
277
|
output.append(",\"stackFrames\":[");
|
|
277
278
|
int count = 0;
|
|
278
279
|
for (StackTraceElement frame : frames) {
|
|
@@ -294,11 +295,15 @@ final class AndroidNativeDiagnostics {
|
|
|
294
295
|
.append(json(safeSymbol(frame.getClassName(), 512, "unknown"))).append("\"}");
|
|
295
296
|
count += 1;
|
|
296
297
|
}
|
|
297
|
-
|
|
298
|
+
if (count == 0) {
|
|
299
|
+
output.setLength(start);
|
|
300
|
+
} else {
|
|
301
|
+
output.append(']');
|
|
302
|
+
}
|
|
298
303
|
}
|
|
299
304
|
|
|
300
305
|
private static void appendContext(StringBuilder output, Configuration value) {
|
|
301
|
-
output.append(",\"context\":{\"resource\":{\"service\":{\"name\":\"")
|
|
306
|
+
output.append(",\"context\":{\"schemaVersion\":1,\"resource\":{\"service\":{\"name\":\"")
|
|
302
307
|
.append(json(value.service)).append("\"},\"deployment\":{\"environment\":\"")
|
|
303
308
|
.append(json(value.environment)).append("\",\"release\":\"")
|
|
304
309
|
.append(json(value.release)).append("\"},\"operatingSystem\":{\"name\":\"Android\",\"version\":\"")
|
|
@@ -321,16 +326,16 @@ final class AndroidNativeDiagnostics {
|
|
|
321
326
|
|
|
322
327
|
private static String safeFilename(String value) {
|
|
323
328
|
String safe = safeSymbol(value, 256, null);
|
|
324
|
-
return safe == null || safe.contains("/") || safe.contains("\\") ? null : safe;
|
|
329
|
+
return safe == null || safe.contains("/") || safe.contains("\\") || safe.contains("?") || safe.contains("#") ? null : safe;
|
|
325
330
|
}
|
|
326
331
|
|
|
327
332
|
private static String safeSymbol(String value, int maximum, String fallback) {
|
|
328
333
|
return value == null
|
|
329
|
-
|| value.isEmpty()
|
|
334
|
+
|| value.trim().isEmpty()
|
|
330
335
|
|| value.length() > maximum
|
|
331
336
|
|| value.chars().anyMatch(character -> character <= 31 || character == 127)
|
|
332
337
|
? fallback
|
|
333
|
-
: value;
|
|
338
|
+
: value.trim();
|
|
334
339
|
}
|
|
335
340
|
|
|
336
341
|
private static String json(String value) {
|
package/index.cjs
CHANGED
|
@@ -16,7 +16,7 @@ const {
|
|
|
16
16
|
} = require("./metadata.cjs");
|
|
17
17
|
|
|
18
18
|
const DEFAULT_SDK_NAME = "logbrew-react-native";
|
|
19
|
-
const DEFAULT_SDK_VERSION = "0.1.
|
|
19
|
+
const DEFAULT_SDK_VERSION = "0.1.25";
|
|
20
20
|
const DEFAULT_ENDPOINT = "https://api.logbrew.co/v1/events";
|
|
21
21
|
const NATIVE_RANDOM_HEX = Symbol.for("co.logbrew.react-native.secure-random-hex");
|
|
22
22
|
const MAX_ACTION_NAME_LENGTH = 64;
|
|
@@ -3,7 +3,7 @@ import Foundation
|
|
|
3
3
|
@objc(LBRNAppleNativeDiagnostics)
|
|
4
4
|
public final class LBRNAppleNativeDiagnostics: NSObject, @unchecked Sendable {
|
|
5
5
|
private static let shared = LBRNAppleNativeDiagnostics()
|
|
6
|
-
private static let sdkVersion = "0.1.
|
|
6
|
+
private static let sdkVersion = "0.1.25"
|
|
7
7
|
|
|
8
8
|
private let lock = NSLock()
|
|
9
9
|
private let replayQueue = DispatchQueue(label: "co.logbrew.react-native.apple-diagnostics-replay")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logbrew/react-native",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"description": "React Native offline delivery, native diagnostics, screen, error, trace, action, and network timeline helpers for LogBrew.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.cjs",
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
"url": "git+https://github.com/LogBrewCo/sdk.git"
|
|
253
253
|
},
|
|
254
254
|
"peerDependencies": {
|
|
255
|
-
"@logbrew/sdk": "^0.1.
|
|
255
|
+
"@logbrew/sdk": "^0.1.20",
|
|
256
256
|
"expo": ">=49",
|
|
257
257
|
"react": ">=18",
|
|
258
258
|
"react-native": ">=0.72"
|