My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
FabricationConsole  
FabricationConsole - Fabrication AIR debugger utility.
Featured
Updated Aug 31, 2010 by rafael.s...@gmail.com

Introduction

Fabrication Console is AIR based application for debugging & developer support for fabrication based applications.

Details

Console is divided into three parts:

  • Flow console, where all important and framework-related events are logged ( actors registrations, commands executions, notification sending etc. ). By clicking small icon on the right you can display a few details about given action.
  • Log console, where developer can log custo messages ( filtered by levels ) and inspect objects.
  • Error console, where problems reports from framework are displayed.

Flow console

To enable flow console logging from your application you have to override fabricationLoggerEnabled method in your application ( module ) main class ( fabricator ):

Example.as

<fabrication:FlexHaloApplication
	xmlns:mx="http://www.adobe.com/2006/mxml"
	xmlns:fabrication="http://puremvc.org/utilities/fabrication/2010"
	>
	<mx:Script>
		<![CDATA[

        import shell.controller.FabricationRoutingDemoShellStartupCommand;

        override public function getStartupCommand():Class  {
            return FabricationRoutingDemoShellStartupCommand;
        }
        override public function get fabricationLoggerEnabled():Boolean   {
            return true;
        }
		]]>
	</mx:Script>
</fabrication:FlexHaloApplication>

  1. logged actions list
  2. click these icons for more details
  3. example of detail window for mediator registration action

Log console

To use custom loggins you have to create Logger instance and add console channel to it:

  var logger:Logger = Log.getLogger( "myLogger" );
  logger.addChannel( FabricationLoggerChannel.getInstance() );

then, you can log messages using five levels ( wich then can be filtered in Log console ) or inspect object:

   logger.debug( "debug message" );
   logger.info( "debug message" );
   logger.warn( "debug message" );
   logger.error( "debug message" );
   logger.fault( "debug message" );

   logger.inspectObject( [ "hello", "from", "fabrication" ], "myArrayOfStrings" );

You can use Log class static methods for more convenient logging. To do so you have to remember to create global logger instance in first place ( logger instance without name ):

  Log.getLogger().addChannel( FabricationLoggerChannel.getInstance() );
  Log.debug( "debug message" );
  Log.info( "debug message" );
  Log.warn( "debug message" );
  Log.error( "debug message" );
  Log.fault( "debug message" );

TIP: you can write you own channel and add it to any instance of Logger class. Remember that your channel has to implement ILogChannel interface ( http://code.google.com/p/fabrication/source/browse/framework/trunk/src/org/puremvc/as3/multicore/utilities/fabrication/logging/channel/ILogChannel.as ).

  1. custom logs window
  2. object inspector grid.

Error console

In here any message from fabrication about something wrong just happened is logged. At this moment these two situations are reported:

  • there is a problem resolving reaction ( typo in reactTo/trapTo methon in sourceName place, event source is null etc. )
  • notification has been sent and no observator is registered for it ( including commands and interceptors ).

If you have any idea about more situations that could be prompted in here, let me know

Download

You can download FabricationConsole AIR package from here: FabricationConsole. Application supports autoUpdate functionality.

Comment by zhaozixu...@gmail.com, Jul 22, 2010

Great!I've been constructing a logger module and FabricationConsole really saved my day. But seems like the "Notification sent" and "Notification routed" logging category in the action panel is not functional yet?

Comment by project member rafael.s...@gmail.com, Aug 13, 2010

"Notification sent" and "Notification routed" logging works fine now.


Sign in to add a comment
Powered by Google Project Hosting