sventon subversion web client - http://www.sventon.org
[show recent changes]
 
  Help
HEAD
Rev: 24120 - http://anonsvn.icesoft.org/repo / projects / bridge-support / src / main / javascript / logger.js
Unified Diff View - logger.js
/projects/bridge-support/src/main/javascript/logger.js @ revision 24119
/projects/bridge-support/src/main/javascript/logger.js @ revision 24120
@@ -48,26 +48,41 @@     }); } -function FirebugLogHandler(priority) { +function ConsoleLogHandler(priority) {     function formatOutput(category, message) {         return join(['[', join(category, '.'), '] ', message], '');     } -    function debugPrimitive(self, category, message, exception) { -        exception ? console.debug(formatOutput(category, message), exception) : console.debug(formatOutput(category, message)); -    } - -    function infoPrimitive(self, category, message, exception) { -        exception ? console.info(formatOutput(category, message), exception) : console.info(formatOutput(category, message)); -    } - -    function warnPrimitive(self, category, message, exception) { -        exception ? console.warn(formatOutput(category, message), exception) : console.warn(formatOutput(category, message)); -    } +    var ieConsole = !window.console.debug; -    function errorPrimitive(self, category, message, exception) { -        exception ? console.error(formatOutput(category, message), exception) : console.error(formatOutput(category, message)); -    } +    var debugPrimitive = ieConsole ? +            function(self, category, message, exception) { +                exception ? console.log(formatOutput(category, message), '\n', exception) : console.log(formatOutput(category, message)); +            } : +            function(self, category, message, exception) { +                exception ? console.debug(formatOutput(category, message), exception) : console.debug(formatOutput(category, message)); +            }; +    var infoPrimitive = ieConsole ? +            function(self, category, message, exception) { +                exception ? console.info(formatOutput(category, message), '\n', exception) : console.info(formatOutput(category, message)); +            } : +            function(self, category, message, exception) { +                exception ? console.info(formatOutput(category, message), exception) : console.info(formatOutput(category, message)); +            }; +    var warnPrimitive = ieConsole ? +            function(self, category, message, exception) { +                exception ? console.warn(formatOutput(category, message), '\n', exception) : console.warn(formatOutput(category, message)); +            } : +            function(self, category, message, exception) { +                exception ? console.warn(formatOutput(category, message), exception) : console.warn(formatOutput(category, message)); +            }; +    var errorPrimitive = ieConsole ? +            function(self, category, message, exception) { +                exception ? console.error(formatOutput(category, message), '\n', exception) : console.error(formatOutput(category, message)); +            } : +            function(self, category, message, exception) { +                exception ? console.error(formatOutput(category, message), exception) : console.error(formatOutput(category, message)); +            };     var handlers = [         Cell(debug, object(function(method) { @@ -116,6 +131,9 @@     }); } +//keep an alias for backward compatibility +var FirebugLogHandler = ConsoleLogHandler; + function WindowLogHandler(thresholdPriority, name) {     var lineOptions = [25, 50, 100, 200, 400];     var numberOfLines = lineOptions[3];


feed icon

sventon 2.5.1