Flex里的日志公共类
import mx.logging.ILogger;
import mx.logging.targets.TraceTarget;
import mx.logging.Log;
public class LoggerManage
{
private var _target:TraceTarget;
public function getLogger(className:String):ILogger
{
if(null == _target)
{
_target = new TraceTarget();//创建一个trace target
_target.includeCategory = true;//显示种类
_target.includeDate = true;//显示日期
_target.includeTime = true;//显示trace的时间
_target.includeLevel = true;// 显示级别(error, debug, info .....)
_target.filters = ["cn.edu.uestc.*" ]; //显示cn.edu.uestc包里类trace出的信息
_target.level = LogEventLevel.INFO //只显示info()信息,其他什么debug()啊error()啊都不显示...
Log.addTarget(_target); //配置好target了把它填到Log里
}
return Log.getLogger(className);
}
}