SOS Logging Target
Wednesday 27 August 2008 @ 6:41 pm

A few days ago Powerflasher released a new version of their logging tool SOS. I have used it in the past but stopped using it because I switched to Mac. Since the new version also runs on OS X I gave the new version a try and it works nicely.

I have posted a little extension for SOS about two years ago and now I made a little update which is easier to use. It works the same way as the TraceTarget I already blogged about.

The project is hosted on Google Code.
In you Flex project simply put this line into you main MXML:

And add the namespace: xmlns:logging=”com.soenkerohde.logging.*”

The rest works like described in my post about TraceTarget.
This version also supports multiline logs which can show up collapsed and can be expanded:

SOS

The application code for the example above:

<!--[CDATA[
			import mx.logging.Log;
			import mx.logging.ILogger;
 
			private static const logger:ILogger = Log.getLogger("Main");
 
			private function init():void
			{
				logger.debug("debug");
				logger.info("info");
				logger.warn("warn");
				logger.error("error");
				logger.fatal("fatal");
 
				logger.info("This is a multiline log example\nwith a second line.");
			}
 
		]]-->
- Posted in ActionScript, Flex by Sönke  




9 Responses to 'SOS Logging Target'

  1. Richard Jewson - September 10th, 2008 at 4:10 pm

    Hi,

    Nice utility, thanks. Might be worth mentioning that after you add the namespace declaration you need to add the logger with:

    ” includeCategory=”true” includeLevel=”true” includeTime=”true”/>

    I do have a problem with using this logger and when my app makes a external network access (via HTTPService for example). It seems to lose connection at that point - Any pointer?

  2. Sönke - September 10th, 2008 at 4:18 pm

    Hi Richard,
    I don’t know why external call might disconncet SOS.
    Do you have a small testcase so I can try it on my own?

  3. Richard Jewson - September 10th, 2008 at 4:45 pm

    Hi,

    I dont have a short but but it happens if:
    1) Setup basic mxml app with SOSLogger
    2) Log something to get the connection running
    3) Call HTTP Service (anything external)
    4) SOS Max then opens a dialog saying ‘Command Error’ and the text of the box is:

    The processing instruction target matching “[xX][mM][lL]” is not allowed.

  4. Richard Jewson - September 10th, 2008 at 5:33 pm

    After some further tests I think it might just be log statements i the Flex Framework. If I filter them out the error doesn’t happen.

  5. Sönke - September 11th, 2008 at 11:18 am

    Hi Richard,
    I updated the SWC. Now “<” in log messages will be replaced with “^” so SOS has no problems with an opening tag. Please try and report if this fixes your problem.

  6. Richard Jewson - September 11th, 2008 at 12:32 pm

    Hi,

    That fixes the problem. The XML looks a bit odd:

    ^tag>somedata^/tag>

    but it works. Thanks for the update!

  7. Sönke - September 11th, 2008 at 12:35 pm

    I know. If you have a better idea let me know.
    I will release the code later this year when I have a bit more time.

  8. Ronzoni - October 7th, 2008 at 9:44 pm

    Hey, great work. thanks. Can you also publish the source code? I tried decompiling the SWC, but it didn’t come out so well.
    I have my own logging framework that I use in AS3 projects, and I’m not using mx.logging.ILoggingTarget. I repackaged and refactored the mx log classes because they statically linked in a bunch of flex stuff.

  9. Sönke - October 9th, 2008 at 12:04 pm

    Hi Ronzoni,
    it’s now on google code: http://code.google.com/p/sosloggingtarget


Leave a Reply