I updated my newrelic_rpm from 3.6.6.147 to 3.9.1.236, and started getting:
"..../gems/command_line_reporter-3.3.2/lib/command_line_reporter.rb:45:in `rescue in formatter='"
Looks like the newrelic gem is doing this "@log.formatter = Proc.new ..." around line 167 of agent_logger.rb, which is conflicting with your formatter= method.
I tried a quick hack with this:
38 def formatter=(type = 'nested')
39 return type if type.class != String
40 name = type.capitalize + 'Formatter'
41 klass = %W{CommandLineReporter #{name}}.inject(Kernel) {|s,c| s.const_get(c)}
42
43 # Each formatter is a singleton that responds to #instance
44 @formatter = klass.instance
45 rescue
46 raise ArgumentError, 'Invalid formatter specified'
47 end
which seemed to stop things from crashing, but haven't had much time to see if this is appropriate or not. Any thoughts?
Hi Wes!
I updated my newrelic_rpm from 3.6.6.147 to 3.9.1.236, and started getting: "..../gems/command_line_reporter-3.3.2/lib/command_line_reporter.rb:45:in `rescue in formatter='"
Looks like the newrelic gem is doing this "@log.formatter = Proc.new ..." around line 167 of agent_logger.rb, which is conflicting with your formatter= method.
I tried a quick hack with this:
38 def formatter=(type = 'nested') 39 return type if type.class != String 40 name = type.capitalize + 'Formatter' 41 klass = %W{CommandLineReporter #{name}}.inject(Kernel) {|s,c| s.const_get(c)} 42
43 # Each formatter is a singleton that responds to #instance 44 @formatter = klass.instance 45 rescue 46 raise ArgumentError, 'Invalid formatter specified' 47 end
which seemed to stop things from crashing, but haven't had much time to see if this is appropriate or not. Any thoughts?