FileAppender. Later this week I got feedback regarding the reading of logs from the
The feedback for the
FileAppenderwas from the beginning rather straightforward. The developer had found that the JavaDoc and the code were not in sync. The documentation stated that there should be a
setDirectory()method available. As it turned out there was no such method. The
getFilename()had the same documentation. In other words a ordinary copy-and-paste mistake. The missing
setDirecotory()method was not so serious, but yet annoying. I implemented the
setDirectory()method within a couple of minutes. I did not really consider the implications of this solution.
What the developer really wanted was a method to set the filename, with or without the full path. He did not want to make a separation between the filename and the directory. The final solution was rather elegant. If the user sets a filename with a full path, this is used. Otherwise the user defined filename is used, but the first root directory is used. A feature request for some kind of rotating file logging was also included. The feature request for a rotating log created two featuture requests at the end, a
What started out as a discussion about an
HTTPAppenderin Microlog, lead to a discussion about how to load a log from the
RecordStore. One developer wanted som examples on how to read the log content. The code was really spread out in the
RecordStoreLogViewerclass. This is a MIDlet that is used for reading the log content. The idea is that you switch to this MIDlet when you want to read the log from another MIDlet. What I did was simple. I extracted the load logging parts from the
RecordStoreLogViewerinto a new class called
RecordStoreLogLoader. This was a good thing. The log reading functionality has no right to exists within the
RecordStoreLogViewerMIDlet. The is a matter of separation of concerns, as some object orientation guru might have put it.
I try to handle the requests with the same tactics I use for my wife; I try to be as responsive as possible. The initial code changes are in place, as well as a snapshot release. These changes will probably lead to a continued discussion. This shows the real power of open source development. With about 3-4 iterations I had a solution that satisfied the developers need, and it took 3-4 days to solve. What a joy it is to be part of an Open Source project (like Microlog)!