默认情况下,程序包logging
仅处理级别INFO的消息。现在我也要记录DEBUG消息。从tutorial我改编了以下代码段:
library(logging)
logReset()
addHandler(writeToConsole)
setLevel("DEBUG", getHandler("writeToConsole"))
getHandler("writeToConsole")[["level"]]==loglevels["DEBUG"]
#TRUE
loginfo("this is an info")
#2018-06-15 13:04:40 INFO::this is an info
logdebug("this is a debug note.")
# nothing happens
我做错了什么?