ActionScript 3.0 Logging API + LunimicBox.Log FlashInspector
Friday, 29 September 2006Throughout almost all of my ActionScript 2.0 development I used the excellent LuminicBox.Log framework (along with the bundled FlashInspector) to debug my Flash applications. With the advent of ActionScript 3.0 / Flex 2 / Flash 9 we now have a logging API but there's no easy way to view the logged information*. To stop me tearing what little hair I have left out I have created the LuminicBoxLoggingTarget class, which can be used with the FlashInspector to debug your applications.
Before I go on I know all the hip kids these days are using the fabulous XRay tool, but sometimes it's a little too heavy-weight for the job of simply logging debug messages to a console. Plus I've not yet got it to play nicely with an ActionScript 3.0 / Flex 2 application.
So, how do you use this fine class?
-
import mx.logging.*;
-
import LuminicBox.Log.LuminicBoxLoggingTarget;
-
-
Log.addTarget(new LuminicBoxLoggingTarget());
-
-
Log.getLogger("test").debug("Hello, world");
As with most of my classes, this is released under the MIT license, so feel free to use it wherever.
* Unless, that is, you've had better luck than me tracking down the mysterious MiniDebug application that's mentioned in the ActionScript 3.0 Logging API documentation.







