class UtilLinuxLogger
UtilLinuxLogger is small utility class intended to be drop in replacement for Syslog. It uses ‘logger` command from util-linux project to provide system logging facilities.
It implements just minimal interface required by ABRT project.
Public Class Methods
Source
# File lib/abrt/util_linux_logger.rb, line 16 def initialize(ident) @ident = ident end
Source
# File lib/abrt/util_linux_logger.rb, line 12 def self.open(ident) self.new(ident) end
Open the UtilLinuxLoggersyslog facility.
‘ident` is a String which identifies the calling program.
Public Instance Methods
Source
# File lib/abrt/util_linux_logger.rb, line 24 def err(format_string, *arguments) log 'user.err', format_string, *arguments end
Source
# File lib/abrt/util_linux_logger.rb, line 20 def notice(format_string, *arguments) log 'user.notice', format_string, *arguments end
Private Instance Methods
Source
# File lib/abrt/util_linux_logger.rb, line 29 def log(priority, format_string, *arguments) IO.popen "logger -p #{priority} -t #{@ident} --socket-errors=off", 'w' do |io| io.write sprintf(format_string, *arguments) end end