You are here

Make Swiz log what it does in Eclipse (or Flex Builder)

I couldn't locate this anywhere, but the Swiz mailing list was very helpful.

If you want to see what Swiz is up to while it's doing it's wiring, you need to do two things.

1) Include the logEventLevel parameter to SwizConfig

<swizframework:SwizConfig xmlns:swizframework="org.swizframework.*"

You'll need to import the mx.logging.LogEventLevel class.

2) Include a TraceTarget tag. I put it just below the SwizConfig.

<mx:TraceTarget id="logTarget" 


Now when you launch your Flex application, you'll see everything Swiz is up to in the Eclipse console window, along with the framework's and your own trace() messages:

9/23/2009 10:06:48.467 [INFO] SwizConfig Init Swiz
9/23/2009 10:06:48.469 [INFO] BeanFactory loading beanloader: 0
9/23/2009 10:06:48.496 [INFO] BeanFactory creating mediator for: get for getEnvironment
9/23/2009 10:06:48.956 [INFO] Swiz autowire clientTrade for added to stage event.
9/23/2009 10:06:48.970 [INFO] Swiz autowire com.falkensweb.flex.baz.view::intro for added to stage event.


By the way, improving our logging is one of the tasks on my to-do list for future releases. We'll be adding more information, categorizing it better and improving the consistency of formatting. Thanks for checking out Swiz!

Thanks for this tip. Didn't know about the LogEventLevel class, it doesn't show up on Ctrl+Shift+T (Open Type window).

I am unable to compile with this attribute and get the following error:

Cannot resolve attribute 'logEventLevel' for component type org.swizframework.SwizConfig

This was a bug in the released version. A fixed version has been posted to the mailing list.

I am using swiz-0.6.4-flex3.swc, which is the latest version I see for flex 3 on the Swiz Framework Files site. Do I need flex 4?

It's not on the files site. That's my I said to use the mailing list.

No, it doesn't require Flex 4.

topical-homopterousif you are reading this, don't click it as it will mark you as a spammer
if you are reading this, don't click it as it will mark you as a spammer