an update on my FirebugLogger class
Posted By Thaylin on June 6, 2008
I decided to tweak the class a bit more so I figured I’d throw it up here.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import flash.external.ExternalInterface; public class FireBugLogger { private static var _enabled:Boolean = false; public function FireBugLogger(singleton:SingletonEnforcer){} public static function set enabled(t:Boolean):void{ _enabled = t; } public static function get enabled():Boolean{ return _enabled } public static function log(s:String):void { if(enabled)call('log', s); } public static function debug(s:String):void { if(enabled)call('debug', s); } public static function info(s:String):void { if(enabled)call('info', s); } public static function warn(s:String):void { if(enabled)call('warn', s); } public static function error(s:String):void { if(enabled)call('error', s); } private static function call(func:String, param:String):void { trace(func+' :: '+param) ExternalInterface.call("console."+func , param) } } class SingletonEnforcer{} |
Comments
Leave a Reply
Please note: Comment moderation is currently enabled so there will be a delay between when you post your comment and when it shows up. Patience is a virtue; there is no need to re-submit your comment.