FireBug, for those that don’t know about it, is a great little tool for debugging your apps online.
One of the many things you can do is use it as a logger. This is excellent for flash development debugging on the server as you can easliy utilize the console.log, console.debug, console.error, console.warn, and console.info. The following is a quick class I wrote up to use this:
package com.mylibrary.log
{
import flash.external.ExternalInterface;
public class FireBugLogger
{
public static function log(s:String):void{
ExternalInterface.call("console.log", s)
}
public static function debug(s:String):void{
ExternalInterface.call("console.debug", s)
}
public static function info(s:String):void{
ExternalInterface.call("console.info", s)
}
public static function warn(s:String):void{
ExternalInterface.call("console.warn", s)
}
public static function error(s:String):void{
ExternalInterface.call("console.error", s)
}
}
}
So now you just import your FireBugLogger package and call FireBugLogger.log(‘HI THERE’), et voila!
Leave a Reply
You must be logged in to post a comment.