Beaver is a logging application and lib for flex/flash applications. It is able to store logs to a LSO, send logs to a Beaver AIR app, generates a log report, can opt in or out of sending to flash console i.e. trace, uses a unique key for all handshakes and offers a channel to handle Error/Fatal events within the application. Regarding the log report generation, any application can perform that task by connecting to Beaver and reading the logs identified by a unique key.
In order to use the logger, a developer must create a unique key starting with an underscore i.e. _123456. After that, it necessary to send a reference to the app instance to assign a handler for dispatched ERROR/FATAL events. Finally create a class to send the logs.
Sample
public class BeaverLog { /** * Constructor expects a unique key for the application * and a flag to send all output to the flash console. * * @param key:String * @param app:Object * @param outputToConsole:Boolean (default = true) */ private static var trunk:BeaverTrunk = new BeaverTrunk("_123456", Example.root); public static function send(message:String, sender:Object, level:int = 4):void { trunk.saveNewLog(message, sender, level); } } BeaverLog.send("Gnaw a log or two", this); BeaverLog.send("The whole tree fell!", this, LogEventLevel.FATAL);
RT @as3gamegears: New: Beaver (logging application and lib) http://t.co/PPlUKyNbxf #as3 #flash #gamedev
Vicente Fleitas liked this on Facebook.