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

Submitted by Falken on

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

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!

Submitted by mrm (not verified) on Thu, 09/24/2009 - 12:36

Permalink

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

Submitted by Frank (not verified) on Mon, 11/09/2009 - 21:12

Permalink

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

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

Submitted by Falken on Sat, 11/14/2009 - 17:11

In reply to by Frank (not verified)

Permalink

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

No, it doesn't require Flex 4.