I saw in some projects that ppl has their own “Debug class”.
So, instead of typing: trace(“look at this!”) you type Debug.trace(“look at this!”).
The only advantaje I saw was that you can disable every single trace call with a single parameter in the Debug class.. but, thats all.
My question is, what advantages can I obtain if I use a Debug class in AS3?
I actually don’t use my debug class that way. I have a logging framework for that, that’s what logging is for. My Debug class has things like
I also have a getLines method — it returns long Strings so that I can easily look at the logging traces and see specific points.
But the most important one:
I even have a wrapper around getStack which returns the class and method which was most recently called before the method which called getStack().