<?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; class ${enclosing_package}.Debug { public static var isOn : Boolean = true; public static var channel : LogChannel = new LogChannel( ClassUtils.getFullyQualifiedClassName( new Debug() ) ); private function Debug() { } public static function DEBUG( o ) : Void { if (Debug.isOn) Logger.LOG( o, LogLevel.DEBUG, Debug.channel ); } public static function INFO( o ) : Void { if (Debug.isOn) Logger.LOG( o, LogLevel.INFO, Debug.channel ); } public static function WARN( o ) : Void { if (Debug.isOn) Logger.LOG( o, LogLevel.WARN, Debug.channel ); } public static function ERROR( o ) : Void { if (Debug.isOn) Logger.LOG( o, LogLevel.ERROR, Debug.channel ); } public static function FATAL( o ) : Void { if (Debug.isOn) Logger.LOG( o, LogLevel.FATAL, Debug.channel ); } /** * Returns the string representation of this instance. * @return the string representation of this instance */ public function toString() : String { return PixlibStringifier.stringify( this ); } } </template> </templates>