module MCollective module Logger # Implements a syslog based logger using the standard ruby syslog class class Syslog_logger e STDERR.puts "Invalid syslog facility #{facility} supplied, reverting to USER" Syslog::LOG_USER end end def set_logging_level(level) # noop end def valid_levels {:info => :info, :warn => :warning, :debug => :debug, :fatal => :crit, :error => :err} end def log(level, from, msg) Syslog.send(map_level(level), "#{from} #{msg}") rescue # if this fails we probably cant show the user output at all, # STDERR it as last resort STDERR.puts("#{level}: #{msg}") end end end end