Commit 9636a22d authored by Mike Dougherty's avatar Mike Dougherty Committed by Commit Bot

Call native JS console methods.

The native console methods must be called in order for messages to be
logged to Safari Developer Tools.

Bug: 899851
Change-Id: I3c1222ad890d490cb6b2212dc6783dcadc1da7f6
Reviewed-on: https://chromium-review.googlesource.com/c/1306114Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Mike Dougherty <michaeldo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603643}
parent 1ea65ada
...@@ -30,23 +30,33 @@ function sendConsoleMessage(method, originalArgs) { ...@@ -30,23 +30,33 @@ function sendConsoleMessage(method, originalArgs) {
}); });
} }
var originalConsoleLog = console.log;
console.log = function() { console.log = function() {
sendConsoleMessage('log', arguments); sendConsoleMessage('log', arguments);
return originalConsoleLog.apply(this, arguments);
}; };
var originalConsoleDebug = console.debug;
console.debug = function() { console.debug = function() {
sendConsoleMessage('debug', arguments); sendConsoleMessage('debug', arguments);
return originalConsoleDebug.apply(this, arguments);
}; };
var originalConsoleInfo = console.info;
console.info = function() { console.info = function() {
sendConsoleMessage('info', arguments); sendConsoleMessage('info', arguments);
return originalConsoleInfo.apply(this, arguments);
}; };
var originalConsoleWarn = console.warn;
console.warn = function() { console.warn = function() {
sendConsoleMessage('warn', arguments); sendConsoleMessage('warn', arguments);
return originalConsoleWarn.apply(this, arguments);
}; };
var originalConsoleError = console.error;
console.error = function() { console.error = function() {
sendConsoleMessage('error', arguments); sendConsoleMessage('error', arguments);
return originalConsoleError.apply(this, arguments);
}; };
}()); }());
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment