flexbuilder3.6 log winows7
flexbuilder:3.6; 操作系统:win7 64bit 问题描述:在开发java项目的时候,前台使用flex展现,后台java程序,通讯使用BlazeDS进行通讯。但是在调试程序时,flex界面有时会出来有时又是灰色的。无法定位问题,所以需要使用log来进行打印。 本篇blog参考:http://www.riameeting.com/node/1042、http://yunzhongxia.iteye.com/blog/1150218,既然人家都是原创,我就转载吧。 1. 卸载现有flash player,下载最新flash player debugger(使用的是IE),截止目前可以下载Download the Windows Flash Player 12 ActiveX control content debugger (for IE)这个版本,地址是http://www.adobe.com/support/flashplayer/downloads.html; 2. 由于系统是win7,且使用的是Administrator登录,所以在C:UsersAdministrator目录下新建mm.cfg文件,内容为:
ErrorReportingEnable=1 TraceOutputFileEnable=1 MaxWarnings=03. 编写 flex代码,进行日志记录。 mxml:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()" > <mx:Script source="script/fansy/testscript.as" /> <mx:Panel id="myPanel" width="100%" height="100%" title="测试"> <mx:ApplicationControlBar> <mx:Label text="this is a test page" /> </mx:ApplicationControlBar> </mx:Panel> </mx:Application>testscript.as:
// ActionScript file [Bindable] private var schemeId:String="" ; import mx.logging.LogLogger; import mx.logging.ILogger; import mx.logging.Log; import mx.logging.LogEventLevel; import mx.logging.targets.TraceTarget; private var logger:ILogger; private function init():void{ var logTarget:TraceTarget = new TraceTarget(); logger = new LogLogger("testlog"); logTarget.filters = ["*"]; logTarget.level = LogEventLevel.ALL; logTarget.includeCategory = true; logTarget.includeDate = true; logTarget.includeLevel = true; logTarget.includeTime = true; logTarget.addLogger(logger); Log.addTarget(logTarget); logger.info("first log in init()"); trace("what the !!!"); }在C:UsersAdministratorAppDataRoamingMacromediaFlash PlayerLogs即可看到日志记录: (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |