StackTrace in Flash / ActionScript 3.0

后端 未结 8 1669
青春惊慌失措
青春惊慌失措 2020-11-28 12:52

I want to see the stack trace in any function of my code, so i made somthing like this to call it and print the stack trace:

public function PrintStackTrace(         


        
8条回答
  •  悲哀的现实
    2020-11-28 12:54

    var tempError:Error = new Error();
    var stackTrace:String = tempError.getStackTrace();
    

    write this stackTrace string into any file so that you can see the logs of your program at run mode also. So you need not to run it in debugger mode only. Write it into uncaughtexception event of application, so it will execute lastly.

提交回复
热议问题