After some crawling, I chose to test:
- log4javascript - http://log4javascript.org;
- stritti log4js - http://stritti.github.io/log4js/;
- loglevel - http://pimterry.github.io/loglevel/.
The first one, log4javascript is really easy to setup and it is nice, as it provides you with complete capabilities and a nice custom GUI, that's really independent from the browser.
The second one, stritti log4js, is also very complete, is similar to log4j and is very flexible. It is not so easy to setup, and I found it to do much more things than I really needed.
The third one has been my choice - it is trivial to setup, the library is only 3Kb in size, and does only what I finally realized I was really looking for.
It fully integrates with the browser's console window, so you have to use that one, but modern browsers have quite a good console window so this is good. It does not break on older browsers, although in these cases it does not log anything.
It completely preserves original line number - this is a really important feature.
So, I chose the third option, loglevel, and even after having worked with it I really recommend it for basic scenarios.
If you want to redirect logging elsewhere, the other two choices are really fine.
No comments:
Post a Comment