Log4Jse是一个非常简洁、可定制的Javascript日志输出管理工具,类似Log4J,但是比它简单很多,可以实现自定义日志输出级别、自定义日志输出方式等功能。
示例代码:
// Usage: var mylog = Logger.get("app"); mylog.log("Hello my app!!"); var viewlog = Logger.get("view"); viewlog.warn("where am I?"); viewlog.error("I don't want work!!"); Logger.get("view").info("Goodbye"); // Above will pop an window, and output these in console: // 2011-10-22 17:20:54,WARNNING[view]: where am I? // 2011-10-22 17:20:54,ERROR[view]: I don't want work!! // 2011-10-22 17:20:54,INFO[view]: Goodbye