Logger Library and RIALogger

Logger Library and RIALogger - (Flex 2+ / Flash Player 9)

2008.01.28 - Latest source

Overview:

The Logger component provides classes to that abstract the Flex 2 Log and logging Target classes. It provides a simple approach to logging messages with category information and provide hooks into multiple targets. It supports the following logging targets by default: RIALoggerTarget, TraceTarget (trace()), XPanelTarget, and FlexTracePanelTarget. The LogController also provides functionality to allow you to setup your own custom logging Target.

You use the class by including the LogController class

XML:
  1. <renaun:LogController
  2.     id="lc"
  3.     defaultTarget="RIALogger"
  4.     defaultFilter="*"
  5.     identifier="MyAPPId" />

This class differs from the Log class by providing static debug, error, info,
warn method calls to abstract the complexity of creating a LogTarget for each instance where you need logging.

CODE:
  1. // Information log method
  2. Logger.info( this, "myFunction did not call sample text" );
  3. Logger.info( MyClass, "myFunction did not call sample text" );
  4. Logger.info( "custom category", "myFunction did not call sample text" );
  5.  
  6. // Inserting parameters into a string
  7. Logger.debug( this, "My Object {0} here I come", "Fred" );
  8. // output: My Object Fred here I come

This class can be used in connection with the new RIALogger.

RIALogger

How to use

  1. Download and install RIALogger.air
  2. Run RIALogger AIR application
  3. Go to http://renaun.com/rialogger/example/TestLogging.html and click on the test buttons.

How to use with your Applications

  1. Download and unzip renaun_com_Logger.zip to a place you can link to in your Flex/AIR projects. (For Firefox, right click and select "Save Link As..")
  2. In the Flex/AIR project goto Project -> Properties -> Flex Library Build Path -> Library Path. Click on the "Add SWC..." button and add the downloaded renaun_com_Logger.swc
  3. Open up the main mxml application file of the Flex/AIR project and include the target code. See example below
      XML:

      1. <renaun:LogController
      2.     id="lc"
      3.     defaultTarget="RIALogger"
      4.     defaultFilter="*"
      5.     identifier="MyAPPId" />

Features

  1. Multiple log tabs, defined by application. Allows for multiple instances of an application to be logged easily.
  2. Filter log items by Categroy
  3. Save logs to a file
  4. Settings panel, set row colors per level, max log items, etc...
  5. Search log for specific text

Components that Use Logger Component:

AdvancedForm


Disclaimer: I work as a Flash/Flex Developer for Adobe Systems Incorporated. The opinions expressed here represent my own and not those of my employer.

My Amazon.com Wish List

Categories

Links

Feeds


Flex.org - The Directory for Flex