📄 tracer.as
字号:
package com.teknision.debug
{
import flash.events.*;
import flash.net.*;
import flash.utils.getTimer;
import mx.core.Application;
import mx.core.UIComponent;
import mx.managers.*;
public class Tracer extends UIComponent
{
static public var asyncError:String = "asyncError";
static public var securityError:String = "securityError";
static public var statusEvent:String = "statusEvent";
static public function trace(i_msg:String,i_thread:String):void{
var myLC:LocalConnection = new LocalConnection();
myLC.addEventListener(AsyncErrorEvent.ASYNC_ERROR,handleAsyncError);
myLC.addEventListener(SecurityErrorEvent.SECURITY_ERROR,handleSecurityError);
myLC.addEventListener(StatusEvent.STATUS,handleStatus);
myLC.allowDomain("*");
var traceObj:Object = new Object();
traceObj.timestamp = getTimer();
traceObj.message = i_msg;
traceObj.threadpath = i_thread;
traceObj.project = Tracer.getProjectName();
myLC.send('_tektrace', 'onTraceData',traceObj);
}
static public function getProjectName():String{
var myName:String = Application.application.name;
return myName;
}
static public function handleAsyncError(event:AsyncErrorEvent):void{
}
static public function handleSecurityError(event:SecurityErrorEvent):void{
}
static public function handleStatus(event:StatusEvent):void{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -