From a4ffd2d49ae7c4d364a43b2a4e6161efdc3f84a2 Mon Sep 17 00:00:00 2001 From: "Tyler G. Hicks-Wright" Date: Fri, 22 Jan 2016 17:16:01 -0700 Subject: [PATCH] Map Util.[Debug|Info|Warn|Error] to console.[debug|info|warn|error]. This change will preserve file and line number reporting when Util.[Debug|Info|Warn|Error] is called, which should make development and debugging a lot easier. --- include/util.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/util.js b/include/util.js index ed0e3cde..b3ee36ad 100644 --- a/include/util.js +++ b/include/util.js @@ -211,13 +211,13 @@ Util.init_logging = function (level) { /* jshint -W086 */ switch (level) { case 'debug': - Util.Debug = function (msg) { console.log(msg); }; + Util.Debug = console.debug.bind(window.console); case 'info': - Util.Info = function (msg) { console.log(msg); }; + Util.Info = console.info.bind(window.console); case 'warn': - Util.Warn = function (msg) { console.warn(msg); }; + Util.Warn = console.warn.bind(window.console); case 'error': - Util.Error = function (msg) { console.error(msg); }; + Util.Error = console.error.bind(window.console); case 'none': break; default: