There is my own log4javascript, which has its own logging console but also provides a wrapper around console.log
. It fulfils all your criteria except keeping line numbers intact, which is impossible to achieve if you’re wrapping calls to console.log()
etc. in another function.
var log = log4javascript.getLogger("main");
var appender = new log4javascript.BrowserConsoleAppender();
log.addAppender(appender);
log.debug("Hello world");