Utilizing FireFox Firebug

Posted By Thaylin on May 16, 2008

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:

?View Code ACTIONSCRIPT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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!


Comments

Leave a Reply