Debugging, stacktrace output

BlitzMax Forums/BlitzMax Beginners Area/Debugging, stacktrace output

Hi Blitzers!

Has anyone made a debug library, or have some quick code for me to allow a runtime stacktrace of my executable? Ideally, the output must be written to a appendable flat file.

I'dlike this sort of output:

22-mei-2006 14:47.00000 ** APP debug starting **
22-mei-2006 14:47.00001 ENTER method Main()
22-mei-2006 14:47.00002 setting variables
22-mei-2006 14:47.00003 setting variables
22-mei-2006 14:47.00004 setting display to 800, 600 depth 32
22-mei-2006 14:47.00005 END method Main()
22-mei-2006 14:47.00006 Application ending
22-mei-2006 14:47.00003 ** APP debug END **


In my program code id would do something like

GLOBAL DebugLog:String = "";

Method Main()
  Local strMethodName1:String = "Main()";

  Debugger.WriteLine("TMain", strMethodName1, "** APP debug starting **");

end Method


I'd rather not reinvent the wheel ;)