Commit e802241c authored by Wandenberg's avatar Wandenberg

Fixes #148 making log messages works when firebug is opened after the page was loaded on Firefox

parent 7b35b05d
...@@ -158,8 +158,7 @@ Authors: Wandenberg Peixoto <wandenberg@gmail.com>, Rogério Carvalho Schneider ...@@ -158,8 +158,7 @@ Authors: Wandenberg Peixoto <wandenberg@gmail.com>, Rogério Carvalho Schneider
debug : function() { if (PushStream.LOG_LEVEL === 'debug') { Log4js._log.apply(Log4js._log, arguments); }}, debug : function() { if (PushStream.LOG_LEVEL === 'debug') { Log4js._log.apply(Log4js._log, arguments); }},
info : function() { if ((PushStream.LOG_LEVEL === 'info') || (PushStream.LOG_LEVEL === 'debug')) { Log4js._log.apply(Log4js._log, arguments); }}, info : function() { if ((PushStream.LOG_LEVEL === 'info') || (PushStream.LOG_LEVEL === 'debug')) { Log4js._log.apply(Log4js._log, arguments); }},
error : function() { Log4js._log.apply(Log4js._log, arguments); }, error : function() { Log4js._log.apply(Log4js._log, arguments); },
_log : function() { _initLogger : function() {
if (!Log4js.logger) {
var console = window.console; var console = window.console;
if (console && console.log) { if (console && console.log) {
if (console.log.apply) { if (console.log.apply) {
...@@ -172,10 +171,21 @@ Authors: Wandenberg Peixoto <wandenberg@gmail.com>, Rogério Carvalho Schneider ...@@ -172,10 +171,21 @@ Authors: Wandenberg Peixoto <wandenberg@gmail.com>, Rogério Carvalho Schneider
}; };
} }
} }
},
_log : function() {
if (!Log4js.logger) {
Log4js._initLogger();
} }
if (Log4js.logger) { if (Log4js.logger) {
try {
Log4js.logger.apply(window.console, arguments); Log4js.logger.apply(window.console, arguments);
} catch(e) {
Log4js._initLogger();
if (Log4js.logger) {
Log4js.logger.apply(window.console, arguments);
}
}
} }
var logElement = document.getElementById(PushStream.LOG_OUTPUT_ELEMENT_ID); var logElement = document.getElementById(PushStream.LOG_OUTPUT_ELEMENT_ID);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment