diff options
author | Tyler G. Hicks-Wright <ty@tghw.com> | 2016-01-22 17:16:01 -0700 |
---|---|---|
committer | Tyler G. Hicks-Wright <ty@tghw.com> | 2016-01-22 17:16:01 -0700 |
commit | a4ffd2d49ae7c4d364a43b2a4e6161efdc3f84a2 (patch) | |
tree | 56875ba309c3a3724bb150192d568c8d84afc407 | |
parent | 670dbddb54264fd0082d0aca1b3acb0f1814b1d2 (diff) | |
download | novnc-a4ffd2d49ae7c4d364a43b2a4e6161efdc3f84a2.tar.gz |
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.
-rw-r--r-- | include/util.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/util.js b/include/util.js index ed0e3cd..b3ee36a 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: |