Log4Jse是一个非常简洁、可定制的Javascript日志输出管理工具,类似Log4J,但是比它简单很多,可以实现自定义日志输出级别、自定义日志输出方式等功能。
示例代码:
//Usage:varmylog=Logger.get("app");mylog.log("Hellomyapp!!");varviewlog=Logger.get("view");viewlog.warn("whereamI?");viewlog.error("Idon'twantwork!!");Logger.get("view").info("Goodbye");//Abovewillpopanwindow,andoutputtheseinconsole://2011-10-2217:20:54,WARNNING[view]:whereamI?//2011-10-2217:20:54,ERROR[view]:Idon'twantwork!!//2011-10-2217:20:54,INFO[view]:Goodbye
评论