
var smashion;if(!smashion)smashion={};if(!smashion.common)smashion.common={};if(smashion.common.logging){throw new Error("smashion.common.logging namespace already exists!");}
smashion.common.logging={}
smashion.common.global.IMPORT("/js/debug/log4javascript.js");smashion.common.logging.getLog=function(options){return new smashion.common.logging.Logger("main",options);}
smashion.common.logging.Logger=Class.create();smashion.common.logging.Logger.prototype={initialize:function(name,options){this.logger=null;this.options=Object.extend({logging:false},options||{});if(!log4javascript){return;}
if(this.options.logging){this.logger=log4javascript.getLogger();var popUpAppender=new log4javascript.PopUpAppender();popUpAppender.setNewestMessageAtTop(true);popUpAppender.setLayout(new log4javascript.PatternLayout("%d{HH:mm:ss,SSS} %-5p - %m{1}%n"));this.logger.addAppender(popUpAppender);}else{this.logger=log4javascript.getNullLogger();}},debug:function(o){if(this.logger)this.logger.debug(this.formatMessage(o));},error:function(o){if(this.logger)this.logger.error(this.formatMessage(o));},formatMessage:function(o){var message;if(o==null){message="";}else if(typeof o=="object"){message=Object.toJSON(o);}else{message=o;}
return message;}}
