Firebase crash tool customize

Eungi KimΒ·2020λ…„ 10μ›” 30일
1

Add custom keys

μ°Έκ³ : CrashlyticsλŠ” μ΅œλŒ€ 64개의 ν‚€-κ°’ μŒμ„ μ§€μ›ν•©λ‹ˆλ‹€. 이 기쀀에 λ„λ‹¬ν•œ ν›„μ—λŠ” μΆ”κ°€ 값이 μ €μž₯λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. 각 ν‚€-κ°’ 쌍의 μ΅œλŒ€ ν¬κΈ°λŠ” 1KBμž…λ‹ˆλ‹€.

// Set a key to a string.
FirebaseCrashlytics.getInstance().setCustomKey("str_key", "hello");

// Set a key to a boolean.
FirebaseCrashlytics.getInstance().setCustomKey("bool_key", true);

// Set a key to an int.
FirebaseCrashlytics.getInstance().setCustomKey("int_key", 1);

// Set a key to a long.
FirebaseCrashlytics.getInstance().setCustomKey("int_key", 1L);

// Set a key to a float.
FirebaseCrashlytics.getInstance().setCustomKey("float_key", 1.0f);

// Set a key to a double.
FirebaseCrashlytics.getInstance().setCustomKey("double_key", 1.0);

Add custom log messages

FirebaseCrashlytics.getInstance().log("Higgs-Boson detected! Bailing out");

Set user identifiers

FirebaseCrashlytics.getInstance().setUserId("12345");

Report non-fatal exceptions

try {
    methodThatThrows();
} catch (Exception e) {
    FirebaseCrashlytics.getInstance().recordException(e);
    // ...handle the exception.
}

https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=android#enable-reporting

profile
Run and gun and debugun

0개의 λŒ“κΈ€