Fixed wrong behaviour in log4xul

javascriptxul

Last week I was coding a little bit on my music player and as everytime I used my little logging-library log4xul. Most of the time I have the Level of the logger set to "debug" so that it prints every message. Because of this I haven't noticed that I have made a really embarrassing mistake with the logging levels in Log4xul. I have mixed the hierarchy of the levels so that with the logging level set to "DEBUG" the logger only prints this debug-messages while when set to "ERROR" it prints everything.

Of cause this is wrong because you want the exactly reverse thing: When the level is set to "DEBUG" you want to get every message and with level set to "ERROR" you only want to get the error messages.

Now I have fixed this so the Log4xul should now work as expected.

Log4Moz

I have also found out that I have not searched enought for other logging frameworks at the time when I started to write Log4xul. In the meantime I have found the Log4Moz framework which is made for logging within firefox extensions. It is a lot more similar to the "original" Log4J and gives you the possibility to create hierarchically structured loggers for your files.

When I first used Log4Moz I was impressed and intended to use it in the future. But then I switched back to my own logger because Log4Moz has no ability to print the messages in a textbox but only to the JSConsole and to a logfile.

I have tried to write my own TextboxAppender for Log4Moz but it only worked till I hit the reload-button. After this it crashed. I don't know if it even would be possibile to write this kind of appender with the achitecture of Log4Moz.