Packagewidgetfactory.logging
Classpublic class WidgetDebugger
InheritanceWidgetDebugger Inheritance Object

WidgetDebugger provides a consistent interface through which to send trace messages to different debugging programs.

To use WidgetDebugger you must first indicate which debugger you wish it to send traces to. This is done by assigning a debugger type to the WidgetDebugger.debugger property. The debugger objects can be found under the widgetfactory.logging.debuggers package. Currently supported debuggers are:

If you wanted to get WidgetDebugger to send traces to Arthropod, then you'd write something like this:

     
         import widgetfactory.logging.WidgetDebugger;
         import widgetfactory.logging.debuggers.WidgetArthropodDebugger;
     
         WidgetDebugger.debugger = new WidgetArthropodDebugger();
     
     

As some debuggers require some data in order to work, their object may have some parameters that you need to pass in when initializing. For example, MonsterDebugger needs you to give it a target object to work with, so when creating the WidgetMonsterDebugger object, you need to pass that in.

     
     WidgetDebugger.debugger = new WidgetMonsterDebugger(stage);
     
     

By default WidgetDebugger will use a DefaultWidgetDebugger object to trace, which will use the normal trace() method to output the messages. The debuggers are located in the

After you have set up a debugger, you can use the:

methods to send traces. For more information on what each of these methods are used for, see below.

If you use a debugger that is not currently supported, contact me here and I'll try my best to add support for it in the next version.

See also

widgetfactory.logging.debuggers


Public Properties
 PropertyDefined By
  debugger : IWidgetDebugger
[static] Holds the object that WidgetDebugger uses to communicate with the debugger program.
WidgetDebugger
  information : Boolean
[static] Toggles whether info messages will be traced or not.
WidgetDebugger
  logging : Boolean
[static] Toggles whether log messages will be traced or not.
WidgetDebugger
  useItemName : Boolean
[static] Toggles whether traces at runtime will display the widget's item name or not.
WidgetDebugger
  warnings : Boolean
[static] Toggles whether warning messages will be traced or not.
WidgetDebugger
  widgetFactoryLogging : Boolean
[static] Toggles whether internal WidgetFactory logs will be traced or not.
WidgetDebugger
Public Methods
 MethodDefined By
  
[static] Clears debugger of all trace messages, if the debugger has that feature.
WidgetDebugger
  
debug(message:String):void
[static] Used for tracing messages which are non-permanent and are used to locate a bug in the program.
WidgetDebugger
  
error(message:String):void
[static] Used for tracing error messages when the program detects an error.
WidgetDebugger
  
fatal(message:String):void
[static] Used for tracing error messages where the error may cause the program to stop running altogether.
WidgetDebugger
  
info(message:String):void
[static] Used for tracing information about the program.
WidgetDebugger
  
log(message:String):void
[static] Used for tracing the general application process.
WidgetDebugger
  
trace(traceObject:Object):void
[static] Used for general traces.
WidgetDebugger
  
warn(message:String):void
[static] Used for tracing warnings when the program does something potentially dangerous.
WidgetDebugger
Property Detail
debuggerproperty
debugger:IWidgetDebugger

Holds the object that WidgetDebugger uses to communicate with the debugger program. To change what debugger WidgetDebugger will trace to, assign the relevant widget debugger object to this property.

The default value is a DefaultWidgetDebugger object.


Implementation
    public static function get debugger():IWidgetDebugger
    public static function set debugger(value:IWidgetDebugger):void
informationproperty 
information:Boolean

Toggles whether info messages will be traced or not.

The default value is true..


Implementation
    public static function get information():Boolean
    public static function set information(value:Boolean):void

See also

loggingproperty 
logging:Boolean

Toggles whether log messages will be traced or not.

The default value is true..


Implementation
    public static function get logging():Boolean
    public static function set logging(value:Boolean):void

See also

useItemNameproperty 
useItemName:Boolean

Toggles whether traces at runtime will display the widget's item name or not.


Implementation
    public static function get useItemName():Boolean
    public static function set useItemName(value:Boolean):void
warningsproperty 
warnings:Boolean

Toggles whether warning messages will be traced or not.

The default value is true..


Implementation
    public static function get warnings():Boolean
    public static function set warnings(value:Boolean):void

See also

widgetFactoryLoggingproperty 
widgetFactoryLogging:Boolean

Toggles whether internal WidgetFactory logs will be traced or not.

The default value is true.


Implementation
    public static function get widgetFactoryLogging():Boolean
    public static function set widgetFactoryLogging(value:Boolean):void
Method Detail
clearTraces()method
public static function clearTraces():void

Clears debugger of all trace messages, if the debugger has that feature.

When testing repeatedly, you may wish to call this in the widget's enterMovie() Template Method. That way you will not get build up of traces from previous tests.

See also

debug()method 
public static function debug(message:String):void

Used for tracing messages which are non-permanent and are used to locate a bug in the program. Can also be used as a highlighted log.

Parameters

message:String

error()method 
public static function error(message:String):void

Used for tracing error messages when the program detects an error.

Parameters

message:String

See also

fatal()method 
public static function fatal(message:String):void

Used for tracing error messages where the error may cause the program to stop running altogether.

Parameters

message:String

See also

info()method 
public static function info(message:String):void

Used for tracing information about the program. Also useful as a highlighted log method.

Parameters

message:String

See also

log()method 
public static function log(message:String):void

Used for tracing the general application process.

Parameters

message:String

trace()method 
public static function trace(traceObject:Object):void

Used for general traces. It is the only trace method that will receive any object and then convert it to a string. All other trace methods will only take a direct string.

Parameters

traceObject:Object

warn()method 
public static function warn(message:String):void

Used for tracing warnings when the program does something potentially dangerous.

Parameters

message:String