我正在查看Log4J文档,无意中看到在Logger#setLevel()
(从Category
继承)方法的描述中有以下内容:
这种要求背后是否有原因?我是不是漏掉了什么?If you are passing any of
Level.DEBUG
,Level.INFO
,Level.WARN
,Level.ERROR
,Level.FATAL
as a parameter, you need to case them asLevel
. As inlogger.setLevel((Level) Level.DEBUG);