After the re-factoring it was time to prove my point, that it is possible to execute Microlog on Android. And it did! The setup was simple, it was Microlog with a
SimpleFormatter. Not so very much at the moment, but I think it is a good starting point.
During the process I learnt that it was in fact possible to see the
System.out.println()statements. Many people claim that it is not possible to see the
System.out.println()in the Console. That is true, but it is possible to get hold of the prints. The trick is to show the "LogCat" view. This is activated this way:
- Select "Window->Show View->Other..."
- Open up the Android category and select "LogCat"
System.err.println(). A nice side effect is that you now can see your Microlog statements as well!
One might ask why should I use Microlog on Android, since there already is a logging API available. This is a perfectly legitimate question. The reason would be that Microlog brings a Log4j like API to the Android platform, but the supplied API is the java.util.logging package. I have always preferred the Log4j API, which was the reason why I choose it for Microlog in the first place. But I guess that you could use Log4j on Android, but Microlog is designed for constrained devices, which Log4j was not.