forked from ianlin/react-native-firebase-crash-report
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
25 lines (20 loc) · 815 Bytes
/
index.js
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
'use strict';
var { Platform, NativeModules } = require('react-native');
const _FirebaseCrashReport = NativeModules.RNFirebaseCrashReport;
export default class FirebaseCrashReport {
static log(message: string) {
_FirebaseCrashReport.log(message);
}
static logcat(message: string, level: number = null, tag: string = null) {
if (Platform.OS === 'ios') {
_FirebaseCrashReport.logcat(message);
} else if (Platform.OS === 'android') {
level = (typeof level !== 'number') ? 3 : level; // --- default level: 3 - DEBUG
tag = (typeof tag !== 'string') ? 'RNFirebaseCrashReport' : tag;
_FirebaseCrashReport.logcat(level, tag, message);
}
}
static report(message) {
_FirebaseCrashReport.report(message);
}
}