See log4r/configurator.rb
Get a parameter’s value
# File lib/log4r/configurator.rb, line 25 def self.[](param); @@params[param] end
Define a parameter with a value
# File lib/log4r/configurator.rb, line 27 def self.[]=(param, value); @@params[param] = value end
Sets the custom levels. This method accepts symbols or strings.
Configurator.custom_levels('My', 'Custom', :Levels)
Alternatively, you can specify custom levels in XML:
<log4r_config> <pre_config> <custom_levels> My, Custom, Levels </custom_levels> ...
# File lib/log4r/configurator.rb, line 42 def self.custom_levels(*levels) return Logger.root if levels.size == 0 for i in 0...levels.size name = levels[i].to_s if name =~ /\s/ or name !~ /^[A-Z]/ raise TypeError, "#{name} is not a valid Ruby Constant name", caller end end Log4r.define_levels *levels end
Given a filename, loads the XML configuration for Log4r.
# File lib/log4r/configurator.rb, line 54 def self.load_xml_file(filename) detect_rexml actual_load Document.new(File.new(filename)) end
Generated with the Darkfish Rdoc Generator 2.