FDT Pixlib template Debug

Tags : , ,
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<template autoinsert="true" context="com.pf.fdt.ui.editor.template.actionscript" deleted="false" description="Creates a class that encapsulates a debug channel for pixlib logging API" enabled="true" name="debug">
import com.bourre.core.HashCodeFactory;
import com.bourre.log.LogChannel;
import com.bourre.log.Logger;
import com.bourre.log.LogLevel;
import com.bourre.log.PixlibStringifier;&#13;
class ${enclosing_package}.Debug&#13;
{&#13;
	public static var isOn : Boolean = true;&#13;
	public static var channel : LogChannel = new LogChannel( ClassUtils.getFullyQualifiedClassName( new Debug() ) );&#13;
	&#13;
	private function Debug() &#13;
	{&#13;
		&#13;
	}&#13;
	&#13;
	public static function DEBUG( o ) : Void&#13;
	{&#13;
		if (Debug.isOn) Logger.LOG( o, LogLevel.DEBUG, Debug.channel );&#13;
	}&#13;
	&#13;
	public static function INFO( o ) : Void&#13;
	{&#13;
		if (Debug.isOn) Logger.LOG( o, LogLevel.INFO, Debug.channel );&#13;
	}&#13;
	&#13;
	public static function WARN( o ) : Void&#13;
	{&#13;
		if (Debug.isOn) Logger.LOG( o, LogLevel.WARN, Debug.channel );&#13;
	}&#13;
	&#13;
	public static function ERROR( o ) : Void&#13;
	{&#13;
		if (Debug.isOn) Logger.LOG( o, LogLevel.ERROR, Debug.channel );&#13;
	}&#13;
	&#13;
	public static function FATAL( o ) : Void&#13;
	{&#13;
		if (Debug.isOn) Logger.LOG( o, LogLevel.FATAL, Debug.channel );&#13;
	}&#13;
	&#13;
	/**&#13;
	 * Returns the string representation of this instance.&#13;
	 * @return the string representation of this instance&#13;
	 */&#13;
	public function toString() : String &#13;
	{&#13;
		return PixlibStringifier.stringify( this );&#13;
	}&#13;
}
</template>
</templates>