function AdfLogger(a,b,c){this.Init(a,b,c)}AdfObject.createSubclass(AdfLogger);AdfLogger.getLogger=function(a){a||(loggername="global");return AdfLogger._LOGGERS[a]};AdfLogger.prototype.register=function(){var a=AdfLogger._LOGGERS,b=this.getName(),c=a[b];if(this!==c){if(c){var d=c.getLogWriter();AdfBufferedLogWriter.prototype.isPrototypeOf(d)&&this.logRecords(d.getLogRecords());d.close()}a[b]=this}return c};AdfLogger.prototype.getName=function(){return this._loggerName};
AdfLogger.prototype.setLevel=function(a){AdfAssert.assertNumeric(a);this._level=a};AdfLogger.prototype.getLevel=function(){return this._level};AdfLogger.prototype.isLoggable=function(a){return a>=this._level};AdfLogger.prototype.getName=function(){return this._loggerName};AdfLogger.prototype.getLogWriter=function(){return this._logWriter};AdfLogger.prototype.setFilter=function(a){AdfAssert.assertFunctionOrNull(a);this._filter=a};AdfLogger.prototype.getFilter=function(){return this._filter};
AdfLogger.prototype.log=function(a){AdfAssert.assert(a);a.level<this._level||this.AddLogRecord(a)};AdfLogger.prototype.logRecords=function(a){AdfAssert.assert(a);for(var b=a.length,c=0;c<b;c++)this.log(a[c])};AdfLogger.prototype.logMessage=function(a,b){AdfAssert.assertNumeric(a);if(!(a<this._level)){this._calcMsg._skipArgs=1;var c=this._calcMsg.apply(this,arguments);this.AddLogRecord(new AdfLogRecord(a,c))}};
AdfLogger.prototype.logError=function(a,b,c){b||(b=AdfLogger.INFO);AdfAssert.assertNumeric(b);b<this._level||(this._calcMsg._skipArgs=2,c=this._calcMsg.apply(this,arguments),this.AddLogRecord(new AdfLogRecord(b,c,a)))};AdfLogger.prototype.logErrorAsSevere=function(a,b){var c=AdfLogger.SEVERE;c<this._level||(this._calcMsg._skipArgs=1,b=this._calcMsg.apply(this,arguments),this.AddLogRecord(new AdfLogRecord(c,b,a)))};
AdfLogger.prototype.logErrorAsWarning=function(a,b){var c=AdfLogger.WARNING;c<this._level||(this._calcMsg._skipArgs=1,b=this._calcMsg.apply(this,arguments),this.AddLogRecord(new AdfLogRecord(c,b,a)))};AdfLogger.prototype.logErrorAsInfo=function(a,b){var c=AdfLogger.INFO;c<this._level||(this._calcMsg._skipArgs=1,b=this._calcMsg.apply(this,arguments),this.AddLogRecord(new AdfLogRecord(c,b,a)))};
AdfLogger.prototype.logElapsedTime=function(a,b,c){AdfAssert.assert(a);c||(c=this.FINE);if(!(c<this._level)){var d=new Date;a=(d.getTime()-a.getTime())/1E3;this.AddLogRecord(new AdfLogRecord(c,b+(a+" seconds"),null,d))}};
AdfLogger.InitClass=function(){this.RegisterLevels(AdfLogger,[{name:"OFF",severity:Number.MAX_VALUE},{name:"SEVERE",severity:1E3},{name:"WARNING",severity:900},{name:"INFO",severity:800},{name:"CONFIG",severity:700},{name:"FINE",severity:500},{name:"FINER",severity:400},{name:"FINEST",severity:300},{name:"ALL",severity:Number.MIN_VALUE}]);this.DEFAULT_LEVEL=this.WARNING;this._LOGGERS={}};
AdfLogger.RegisterLevels=function(a,b){AdfAssert.assertFunction(a);var c=a.prototype;a.__reverseMap={};for(var d=b.length,e=["if (this.",null,"\x3cthis._level) return; this._calcMsg._skipArgs \x3d 0; this.logMessage(this.",null,",this._calcMsg.apply(this, arguments));"],f=0;f<d;f++){var g=b[f],h=g.name,g=g.severity;a.__reverseMap[g]=h;a[h]=g;c[h]=g;g!=Number.MAX_VALUE&&g!=Number.MIN_VALUE&&(e[1]=h,e[3]=h,e.join(""),h=h.toLowerCase(),c[h]=function(a){})}};
AdfLogger.prototype._calcMsg=function(a){var b=arguments.callee._skipArgs,c=arguments.length,d=arguments[b];if(1==c-b&&"string"==typeof d)return d;for(d="";b<c;b++)d+=arguments[b];return d};AdfLogger.prototype.Init=function(a,b,c){AdfAssert.assert(a,"loggerName required");AdfAssert.assert(b,"logWriter required");AdfLogger.superclass.Init.call(this);this._logWriter=b;this._loggerName=a;this._level=void 0!==c?c:AdfLogger.DEFAULT_LEVEL;this._filter=null};
AdfLogger.prototype.toDebugString=function(){return this.getTypeName()+" [loggerName:'"+this._loggerName+"',level:"+this._level+",logWriter:"+this._logWriter+"]"};AdfLogger.prototype.AddLogRecord=function(a){var b=this._filter;b&&!b(a)||this.getLogWriter().publish(a)};AdfLogger.LOGGER=new AdfLogger("global",new AdfBufferedLogWriter);AdfLogger.LOGGER.register();