//richinternet.blog

Viewing By Entry / Main
Thursday, June 3, 2004
Flex Trace Panel 1.1

UPDATE: Version 1.5b2 of the Trace Panel is available here!

I have updated the Flex Trace Panel to version 1.1 and added a Dumper class that makes tracing easier. The class provides several convenience methods to trace/dump messages out of your app into the panel.The download is available here.

UPDATE: I also coded a little helper app, that starts the Trace Panel "always-on-top" - more info here.

The archive consists of the updated panel as a standalone exe and the Dumper class file (inside the "src" folder). To make the Dumper class available to all your MXML applications extract it into the [YourInstallDir]\Flex\WEB-INF\flex\user_classes directory and leave the folder structure intact.

The Dumper class is a static class and provides five methods (four of them are just shortcuts actually) and three different log levels. The levels are 2 (or Dumper.INFO), 4 (Dumper.WARN) and 8 (Dumper.ERROR).

  • de.richinternet.utils.Dumper.dump(message:Object, level:Number):Void
    takes the passed Object (any type) and routes it to the Flex Trace Panel, the 2nd paramter is optional and refers to the different log levels of the Dumper class (the default is Dumper.INFO)

  • de.richinternet.utils.Dumper.trace(message:Object):Void
    takes the passed Object (any type) calls the Dump.dump() method with log level Dumper.INFO (2).

  • de.richinternet.utils.Dumper.info(message:Object):Void
    takes the passed Object (any type) calls the Dump.dump() method with log level Dumper.INFO (2).

  • de.richinternet.utils.Dumper.warn(message:Object):Void
    takes the passed Object (any type) calls the Dump.dump() method with log level Dumper.WARN (4).

  • de.richinternet.utils.Dumper.error(message:Object):Void
    takes the passed Object (any type) calls the Dump.dump() method with log level Dumper.ERROR (8).

Here is a simple example on how use the Dumper class:
import de.richinternet.utils.Dumper;

function traceTest() {
Dumper.dump("a normal message");
Dumper.info("also a normal message");
Dumper.warn("oops, a warning message");
Dumper.error("Houston we have a problem!");
Dumper.dump("this is also an error!", Dumper.ERROR);
}

Together with the updated Flex Trace Panel you are now able to filter the messages, if you select the "ERROR" radiobutton control for example only messages with a level of Dumper.WARN will be displayed. This is what it looks like if you run the above example with a filter setting of "ALL":

BTW: The filter does not work on the already displayes messages in the Panel but only on all future messages.

I also put an experimental method into the Dumper class called Dumper.setHook() that adds shortcut functions to the Application.application scope. After you called Dumper.setHook() the dump(), warn(), and error() functions are available directly in the application's main scope - the only thing you have to do is declaring the functions, otherwise the compiler will throw a warning.

Dirk.

Comments

Thank you very much for this tool. The tools are invaluable to someone learning about Flex and AS.


Agreed, this is an awesome tool wether you are learning or not. I regularly use it throughout the course of development and the 1.5b release offers some great enhancements & features.

However with this version I really miss the “clear” button (in 1.1) to clear the panels’ contents :-(

Any chance this could be resurrected? Becoming frustrating to always go File > Clear. Like the use of putting the other functions in menu though.


The "clear" button is back again, make sure to check out version 1.5b2, URL is

http://www.richinternet.de/blog/index.cfm?entry=8F0C9A56-D3C1-55A6-0EAE917D5A7E6D86

Dirk.


Hey Dirk. I'm back using Flex v.2.0.143459, and I'm having trouble getting Dumper to work.

On compile, I'm getting the error "A file found in a source-path must have an externally visible definition. If a definition in the file is meant to be externally visible, please put the definition in a package." out of Dumper.as.

I installed to the root of the application, so I shouldn't be having any class path issues.

Any ideas? Thanks! -Carl


Hey Dirk. I'm back using Flex v.2.0.143459, and I'm having trouble getting Dumper to work.

On compile, I'm getting the error "A file found in a source-path must have an externally visible definition. If a definition in the file is meant to be externally visible, please put the definition in a package." out of Dumper.as.

I installed to the root of the application, so I shouldn't be having any class path issues.

Any ideas? Thanks! -Carl




Sun Mon Tue Wed Thu Fri Sat
   1234
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30   

About this blog
www.richinternet.de

AIR (9)
Apollo (3)
BlazeDS (8)
Breeze (1)
Central (5)
ColdFusion (54)
Flash (57)
Flash Media Server (6)
Flex (160)
Flex Trace Panel (6)
FXUG (3)
J2Flex (4)
MAX (31)
Mobile (1)
mxmlc (1)
Other topics (42)
Plugins (5)
Video (4)

Copy Fully Qualified Classname Plugin for Flash Builder 4 (CFQCN)

Recent Flex Technotes
Recent ColdFusion Technotes
Recent Flash Technotes

http://www.flexperten.de
http://www.flexforum.de
http://www.flex.org
http://www.bloginblack.de
http://www.cflex.net
flexcoders mailing-list
flexcoders archive
more links...

Aggregated by fullasagoog.com
Aggregated by MXNA

Short Mode | Full Mode

Herrlich & Ramuschkat