
var log={loggers:{info:[],debug:[],warn:[],error:[]},info:function(message){this.message('info',message);},warn:function(message){this.message('warn',message);},error:function(message){this.message('error',message);},debug:function(message){this.message('debug',(typeof message=='object')?this._dumpObject(message):message);},message:function(type,message)
{if(type==undefined)
type='info';if(message==null)
message='(null)';for(var i in this.loggers[type])
this.loggers[type][i](message);},registerLoggers:function(loggers)
{for(var i in loggers){if(this.loggers[i]!=undefined){this.loggers[i].push(loggers[i]);}}},_dumpObject:function(object,step)
{if(step==undefined)step=0;if(step>1)return'';space=new Array(step).join('-> ');dump='';for(var key in object){var value=object[key];var type=typeof value;switch(type){case'string':case'number':case'boolean':value='<font color="green">('+type+')</font> <font color="red">'+value+'</font>';break;case'object':value='<font color="cyan">(object)</font>';break;case'function':value='<font color="yellow">(function)</font>';break;default:value='<font color="gray">('+type+')</font>';}
dump+=key+': '+value+'<br/>';}
return dump;}};
