-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlog_util.js
More file actions
executable file
·44 lines (41 loc) · 1.08 KB
/
log_util.js
File metadata and controls
executable file
·44 lines (41 loc) · 1.08 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { Sentry, SentrySeverity } from 'react-native-sentry';
import DeviceUtil from './device_util';
module.exports = {
setUser: function (email, userId, name) {
Sentry.setUserContext({
email: email,
userID: userId,
username: name
});
},
setGlobalTags: function (tags) {
Sentry.setTagsContext(tags);
},
logErrorMessage: function (message, tags) {
if (!DeviceUtil.isProductionMode()) {
return;
}
Sentry.captureMessage(message, {
level: SentrySeverity.Error,
tags: tags
});
},
test: function (lineNumber) {
return lineNumber;
// var err = this;
// var caller_line = err.stack.split("\n")[4];
// var line = (new Error).stack.split("\n")[2];
// line = (line.indexOf(' (') >= 0
// ? line.split(' (')[1].substring(0, line.length - 1)
// : line.split('at ')[1]
// );
//
// return this.lineNumber;
}
};
/* Sample usage
LogUtil.logErrorMessage("Something went wrong", {
"lineNumber": 12,
"file": "home.js"
});
*/