Archive for January 2005

 
 

Logging works

Sometimes I surprise even myself! And it only took 3 hours.

JNLP & Logging

I took a look at JNLP. I have made some choices about loading resources that wont allow mindshare to work as a JNLP app until they are fixed. Basically this was a testing convenience. I can set the working directory on each instance to be different and everything will be stored in that directory. This is great when you are running two or three peers on the same machine as a test. JNLP puts things in strange places and renames resources. The ‘right’ thing to do is to store everything in the users home directory. This would only allow one peer per user to run. The right solution it to allow the app to take command line parameters to put it into testing mode. This would probably take a day or more to fix so I wont get JNLP working any time soon.

I switched to Log4J from Java’s built in logging API. I am very happy with the switch but the log window in the app has broken. What I really want is a coloured log output in the log window. Something like this:

<DEBUG> this is a debug message
<INFO> this is a info message
<WARN> this is a warning message
<ERROR> this is a error message
<FATAL> this is a fatal message

 This would make debugging at any location just a bit easier. The output would be in HTML of course and you could save the logs. Trouble is there appears to be no off the shelf solution for hooking up a log appender to a JTextPane. i wrote the Layout in about 10 minutes though. I may take another crack at this tonight because I really like the idea of being able to read the logs anywhere.

Changelog

Not a very productive day but its the first real work i have done in about a week.

New:

  • Work on BEEP connections between peers.
  • Peers decide who is the ‘client’ and the ‘server’ by comparing the URI’s of their respective JXTA PeerID’s. The lesser PeerID is the client and thus responsible for making the connection.

Refactoring:

  • All the old logging code is now replaced with Log4J.

Bugs:

  • Fixed a subtle bug in Presence that happened when peers went offline and came back rapidly. The per record would be replaced and a timer task would remove a different but ‘equal()’ record.
  • Fixed a synchronization bug in Presence shutdown where concurrent modification could occur in the peer list.
  • Found a subtle bug in the buddy list display. If the list is interacted before all peers appear online it will not display new peers. Most curious.
  • Also the buddy list is not being saved as it was before. This is actually a cool feature at this phase of testing so it may be made optional with the default being true.

MediaWiki

MediaWiki MediaWiki looks cool.I’m a big fan of Wiki’s in general and I want to use one here. I like the idea of using a Wiki for things like a manual, quick start guide etc. MediaWiki could handle this blog by the looks of it. JXTA has a wiki, however the primary resource for JXTA information and discussion is the dev mailing list. The problem with mailing lists and forums in general is information loss. Users must be clever enough to search for the right information. Wiki’s encourage knowledge hoarding. Wiki pages snowball to cover all knowledge of that area. The Wiki’s problem is page rot. You have to maintain and refactor the pages as things change or they become obsolete and misguiding. Forums and mailing lists are best for discussion transient topics where information loss is inconsequential.

Overall I like the Wiki over the mailing list or a forum so installing one is on my todo list probably in late February.