Dodanie obsługi wielu argumentół do $.log.
[redakcja.git] / project / static / js / jquery.logging.js
1 (function($) {
2         const LEVEL_DEBUG = 1;
3         const LEVEL_INFO = 2;
4         const LEVEL_WARN = 3;
5
6         const LOG_LEVEL = LEVEL_DEBUG;
7
8         var mozillaLog = function() {
9                 if (window.console) console.log.apply(this, arguments);
10         };
11
12         var operaLog = function() {
13                 opera.postError.(arguments.join(' '));
14         };
15
16         var defaultLog = function() { return false; };
17
18         $.log = function( ) {
19                 return $.log.browserLog.apply(this, arguments);
20         };
21
22         if ($.browser.mozilla || $.browser.safari)
23                 $.log.browserLog = mozillaLog;
24         else if($.browser.opera)
25                 $.log.browserLog = operaLog
26         else 
27                 $.log.browserLog = defaultLog;
28
29
30 })(jQuery);