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

Submitted by Falken on Wed, 09/23/2009 - 10:10

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.*"
    beanLoaders="{[EnvironmentBeans]}"
    logEventLevel="{LogEventLevel.DEBUG}"
/>

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" 
    includeDate="true"
    includeTime="true"
    includeCategory="true"
    includeLevel="true"
/>

 

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.
Sections

mrm (not verified)

Thu, 09/24/2009 - 12:36

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