Extension for Zeroi: XTracePublisher

Posted on March 12, 2007

Xtrace is a popular debugger console on OS X for logging your trace() data outside the Flash IDE. For easier handling I decided to write an extension for Zeroi that keeps your standard trace() methods in your code.

Here is a screen of a XTrace window receiving Zerois debug messages:

XTrace Window

Instructions

  • Grab the latest source of Zeroi from its Subversion Repository. You will find there the new extension for XTrace, too.
  • Download and install XTrace. For enjoying the latest features (e.g. text highlighting) it's recommended to use the XTrace SVN Repository.
  • Download the Zeroi example and follow the steps 4 up to 7 described in my previous post called "Debugging with MTASC, Ant and Zeroi".
  • Add XTracePublisher as Zerois publisher to MTASC -trace flag. For this purpose you have to change only one line in the Ant script located in my example:
<arg value="-trace"/>
<arg value="org.osflash.Zeroi.logging.LoggerClass.log"/>
<arg value="org/osflash/Zeroi/logging/LoggerClass"/>
<!-- point this argument to XTracePublisher -->
<arg value="org/osflash/Zeroi/logging/publisher/XTracePublisher"/>
  • If you familiar with Terminal you can also create a small shell script to run MTASC instead using Ant. Open Terminal, change directorycd {path/to/downloaded/zeroiExample}and create a new file named buildpico ./build Type then the following line for running MTASC:
1 {path/to/mtasc} -cp {path/to/your/own/core/classes} -cp {path/to/MM/core/classes} -cp {path/to/zeroi/class/package} -cp ./source/ -swf ./deploy/zeroiExample.swf ./ZeroiExample.as -trace org.osflash.Zeroi.logging.LoggerClass.log org/osflash/Zeroi/logging/LoggerClass org/osflash/Zeroi/logging/publisher/XTracePublisher -frame 1 -version 7 -v -main

For opening the *.swf with the FlashPlayer type additionally:

open -a SAFlashPlayer ./deploy/zeroiExample.swf

Save the file, close pico and run the script typing ./build

Wish list

  • Adding more log levels, such as "INFO" and "FATAL". I've got in contact with Michael Bianco ;-) .

Any feedback?

comments powered by Disqus