class Log4r::YamlConfigurator

See log4r/yamlconfigurator.rb

Constants

ExcludeParams

Public Class Methods

[](param) click to toggle source

Get a parameter’s value

# File lib/log4r/yamlconfigurator.rb, line 24
def self.[](param); @@params[param] end
[]=(param, value) click to toggle source

Define a parameter with a value

# File lib/log4r/yamlconfigurator.rb, line 26
def self.[]=(param, value); @@params[param] = value end
custom_levels( levels) click to toggle source
# File lib/log4r/yamlconfigurator.rb, line 29
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 =~ %r\s/ or name !~ %r^[A-Z]/
      raise TypeError, "#{name} is not a valid Ruby Constant name", caller
    end
  end
  Log4r.define_levels *levels
end
load_yaml_file( filename) click to toggle source

Given a filename, loads the YAML configuration for Log4r.

# File lib/log4r/yamlconfigurator.rb, line 41
def self.load_yaml_file( filename)
  actual_load( File.open( filename))
end
load_yaml_string( string) click to toggle source

You can load a String YAML configuration instead of a file.

# File lib/log4r/yamlconfigurator.rb, line 46
def self.load_yaml_string( string)
  actual_load( string)
end