Skip to content

An implementation of the Kap Lab debugging console for the Swiz framework

License

Notifications You must be signed in to change notification settings

brian428/Swiz-Console

Repository files navigation

The Swiz Console (download swc) is an implementation of the Kap Lab debugging console. It offers a number of features that help in building and debugging Swiz-based applications. Note that right now this only works with the 4.x SDK, since building a 3.x SDK version will require conditional compilation to generate separate swcs.

Using the Swiz Console
After you add the swc to your project (typically in the /libs folder), using the console is very straightforward:

In whatever page contains your Swiz configuration (usually Application or WindowedApplication), add the namespaces for the custom metadata processors and the custom logging class:

xmlns:logging="org.swizframework.console.logging.*"
xmlns:processors="org.swizframework.console.processors.*"

Next, modify your Swiz configuration to use the custom logger and processors:

<swiz:Swiz id="mySwiz">
	<swiz:config>
		<swiz:SwizConfig id="mySwizConfig" eventPackages="my.events.*" viewPackages="my.views.*" />
	</swiz:config>
	<swiz:beanProviders>
		<local:Beans />
	</swiz:beanProviders>
	<swiz:loggingTargets>
		<swiz:SwizTraceTarget id="myTraceTarget" />
		<logging:KapITSwizLoggingTarget id="kapITLoggingTarget" />
	</swiz:loggingTargets>
	<swiz:customProcessors>
		<processors:InspectableMetadataProcessorArray />
	</swiz:customProcessors>
</swiz:Swiz>
The custom Array is there as a convenience, to cover most situations. If you have your own custom processors in use already, just add all of the custom Swiz console processors (InspectableDispatcherProcessor, InspectableEventHandlerProcessor, InspectableInjectProcessor, InspectablePostConstructProcessor, InspectablePreDestroyProcessor, InspectableSwizInterfaceProcessor, InspectableViewProcessor, and InspectableSwizProcessor) individually.

Finally, add an onApplicationComplete handler and initialize the console:

private function onApplicationComplete() : void
{
	var p : SwizConsole = new SwizConsole();
	p.showPopup();
}
If you close the console (or you remove the showPopup() call if you don't want it to show up immediately), you can open the console by doing a control-alt click on the application.

About

An implementation of the Kap Lab debugging console for the Swiz framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published