Class: UtilLinuxLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/abrt/util_linux_logger.rb

Overview

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.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ident) ⇒ UtilLinuxLogger

Returns a new instance of UtilLinuxLogger.



16
17
18
# File 'lib/abrt/util_linux_logger.rb', line 16

def initialize(ident)
  @ident = ident
end

Class Method Details

.open(ident) ⇒ Object

:yields: syslog

Open the UtilLinuxLoggersyslog facility.

‘ident` is a String which identifies the calling program.



12
13
14
# File 'lib/abrt/util_linux_logger.rb', line 12

def self.open(ident)
  self.new(ident)
end

Instance Method Details

#err(format_string, *arguments) ⇒ Object



24
25
26
# File 'lib/abrt/util_linux_logger.rb', line 24

def err(format_string, *arguments)
  log 'user.err', format_string, *arguments
end

#notice(format_string, *arguments) ⇒ Object



20
21
22
# File 'lib/abrt/util_linux_logger.rb', line 20

def notice(format_string, *arguments)
  log 'user.notice', format_string, *arguments
end