-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #429 from rollbar/react-native
beginning of react native support
- Loading branch information
Showing
12 changed files
with
613 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
/* eslint-disable no-console */ | ||
var logger = { | ||
error: console.error.bind(console), | ||
info: console.info.bind(console), | ||
log: console.log.bind(console) | ||
}; | ||
/* eslint-enable no-console */ | ||
|
||
module.exports = logger; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
var _ = require('../utility'); | ||
var logger = require('./logger'); | ||
|
||
function checkLevel(item, settings) { | ||
var level = item.level || 'error'; | ||
var reportLevel = settings.reportLevel; | ||
|
||
var levelVal = _.LEVELS[level] || 0; | ||
var reportLevelVal = _.LEVELS[reportLevel] || 0; | ||
|
||
if (levelVal < reportLevelVal) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
function userCheckIgnore(item, settings) { | ||
var isUncaught = !!item._isUncaught; | ||
delete item._isUncaught; | ||
var args = item._originalArgs; | ||
delete item._originalArgs; | ||
try { | ||
if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) { | ||
return false; | ||
} | ||
} catch (e) { | ||
settings.checkIgnore = null; | ||
logger.error('Error while calling custom checkIgnore(), removing', e); | ||
} | ||
return true; | ||
} | ||
|
||
module.exports = { | ||
checkLevel: checkLevel, | ||
userCheckIgnore: userCheckIgnore | ||
}; | ||
|
Oops, something went wrong.