Skip to content

Commit 5b9d456

Browse files
committed
Merge pull request #181 from QuentinFchx/patch-1
Fix console plugin infinite loop
2 parents 411df87 + 90e9535 commit 5b9d456

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugins/console.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ var originalConsole = console,
1212
level;
1313

1414
var logForGivenLevel = function(level) {
15+
var originalConsoleLevel = console[level];
1516
return function () {
1617
var args = [].slice.call(arguments);
1718
Raven.captureMessage('' + args, {level: level, logger: 'console'});
1819

1920
// this fails for some browsers. :(
20-
if (originalConsole[level]) {
21-
originalConsole[level].apply(null, args);
21+
if (originalConsoleLevel) {
22+
originalConsoleLevel.apply(originalConsole, args);
2223
}
2324
};
2425
};

0 commit comments

Comments
 (0)