PMD规则之Jakarta Commons Logging Rules

·  UseCorrectExceptionLogging: To make sure the full stacktrace is printed out, use the logging statement with 2 arguments: a String and a Throwable.

翻译   使用正确的异常日志:保证打印出完全的异常堆栈,记录或抛出异常日志时使用包含两个参数的表达式:一个参数是字符串,一个是Throwable类型

·  ProperLogger: A logger should normally be defined private static final and have the correct class. Private final Log log; is also allowed for rare cases where loggers need to be passed around, with the restriction that the logger needs to be passed into the constructor.

翻译   合适的日志记录器:日志记录器一般应该被定义为private static final的,而且应该有正确的类。Private final Log log;也被允许使用在需要传递的这种极少的情况中,具有这种限制日志记录器就需要被传入构造器中。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值