虽然在Ruby中使用log4r
,我写了类似的配置文件中的以下内容:红宝石:未初始化不断log4r的:: DEBUG(NameError)问题
require 'rubygems'
require 'log4r'
require 'log4r/outputter/datefileoutputter'
SERVICE_LOG = {
:log_name => 'service',
:log_file => 'service.log',
:log_level => Log4r::DEBUG,
:message_pattern => "[%-5l %d] %C: %M",
:date_pattern => "%Y-%m-%d %H:%M:%S"
}
,当我跑它,它抛出了以下异常:
C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Log4r::DEBUG (NameError)
它为什么这样做?
非常酷,非常感谢你! – ywenbo 2011-04-27 07:15:12