真正做项目,才发觉Logging的好处和学问.自己胡搞的时候,常常使用System.out.println作为输出. 但实际的项目,尤其是library比较多的时候,好好配置好Logging,才能在后面的工作以及追查结果时,事半功倍.否则,很有可能无法获取所有的log以致无法追查问题发生的原因. 首先介绍的,是最传统的log4j.log4j的使用相当简单.例子如下: // get a logger instance named "com.foo" Logger logger = Log…
''' logging模块: logging的日志可以分为 debug():Detailed information, typically of interest only when diagnosing problems. info():Confirmation that things are working as expected. warning():An indication that something unexpected happened, or indicative of som…