X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/a21670989205979ee667eda0a6e6ba4c2546da6f..1946d77911c974e2755d59891f34337a8af829b6:/project/static/js/jquery.logging.js diff --git a/project/static/js/jquery.logging.js b/project/static/js/jquery.logging.js index 1afd8bec..0f0df519 100644 --- a/project/static/js/jquery.logging.js +++ b/project/static/js/jquery.logging.js @@ -5,29 +5,32 @@ const LOG_LEVEL = LEVEL_DEBUG; - var mozillaLog = function(msg) { - if (window.console) console.log(msg); + var mozillaLog = function() { + if (window.console) + console.log.apply(this, arguments); }; - var operaLog = function(msg) { - opera.postError(msg); + var safariLog = function() { + if (window.console) + console.log.apply(console, arguments); + }; + + var operaLog = function() { + opera.postError(arguments.join(' ')); }; - var defaultLog = function(msg) { return false; }; + var defaultLog = function() { return false; }; - $.log = function(message, level) { - if (level == null) level = LEVEL_INFO; - if (message == null) message = 'TRACE'; - if (level < LOG_LEVEL) - return false; - - return $.log.browserLog(message); + $.log = function( ) { + return $.log.browserLog.apply(this, arguments); }; - if ($.browser.mozilla || $.browser.safari) + if ($.browser.mozilla) $.log.browserLog = mozillaLog; + else if ($.browser.safari) + $.log.browserLog = safariLog; else if($.browser.opera) - $.log.browserLog = operaLog + $.log.browserLog = operaLog; else $.log.browserLog = defaultLog;