Skip to content

Commit

Permalink
Fix default logger's loglevel, improve default error handler
Browse files Browse the repository at this point in the history
Reviewed By: majak

Differential Revision: D2834267

fb-gh-sync-id: c89ce5160f03f57409497cc802690c8360d88a4d
  • Loading branch information
javache authored and facebook-github-bot-2 committed Jan 20, 2016
1 parent 52c2533 commit 1dffd05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion React/Base/RCTLog.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void RCTPerformBlockWithLogPrefix(void (^block)(void), NSString *prefix)
[log appendString:[formatter stringFromDate:timestamp]];
}
if (level) {
[log appendFormat:@"[%s]", RCTLogLevels[level - 1]];
[log appendFormat:@"[%s]", RCTLogLevels[level]];
}

[log appendFormat:@"[tid:%@]", RCTCurrentThreadName()];
Expand Down
11 changes: 3 additions & 8 deletions packager/react-packager/src/Resolver/polyfills/error-guard.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,12 @@

/**
* This is the error handler that is called when we encounter an exception
* when loading a module.
* when loading a module. This will report any errors encountered before
* ExceptionsManager is configured.
*/
function setupErrorGuard() {
var onError = function(e) {
global.console.error(
'Error: ' +
'\n stack: ' + e.stack +
'\n line: ' + e.line +
'\n message: ' + e.message,
e
);
global.console.error('Error: ' + e.message + ', stack:\n' + e.stack);
};
global.ErrorUtils.setGlobalHandler(onError);
}
Expand Down

0 comments on commit 1dffd05

Please sign in to comment.