class Puppet::Util::Log::Destination
A type of log destination.
Attributes
name[RW]
Public Class Methods
initvars()
click to toggle source
# File lib/puppet/util/log/destination.rb 7 def self.initvars 8 @matches = [] 9 end
match(obj)
click to toggle source
Mark the things we're supposed to match.
# File lib/puppet/util/log/destination.rb 12 def self.match(obj) 13 @matches ||= [] 14 @matches << obj 15 end
match?(obj)
click to toggle source
See whether we match a given thing.
# File lib/puppet/util/log/destination.rb 18 def self.match?(obj) 19 # Convert single-word strings into symbols like :console and :syslog 20 if obj.is_a? String and obj =~ /^\w+$/ 21 obj = obj.downcase.intern 22 end 23 24 @matches.each do |thing| 25 # Search for direct matches or class matches 26 return true if thing === obj or thing == obj.class.to_s 27 end 28 false 29 end
sethandler(&block)
click to toggle source
Set how to handle a message.
# File lib/puppet/util/log/destination.rb 40 def self.sethandler(&block) 41 define_method(:handle, &block) 42 end
setinit(&block)
click to toggle source
Mark how to initialize our object.
# File lib/puppet/util/log/destination.rb 45 def self.setinit(&block) 46 define_method(:initialize, &block) 47 end
Public Instance Methods
name()
click to toggle source
# File lib/puppet/util/log/destination.rb 31 def name 32 if defined?(@name) 33 return @name 34 else 35 return self.class.name 36 end 37 end