Hi,
I want to change the logging level of an application (ruby).
require 'logger'
config = { :level => 'Logger::WARN' }
log = Logger.new STDOUT
log.level = Kernel.const_get config[:level]
Well, the irb wasn't happy with that and threw "NameError: wrong constant name Logger::WARN" in my face. Ugh! I was insulted.
I could do this in a case/when to solve this, or do log.level = 1, but there must be a more elegant way!
Does anyone have any ideas?
-daniel