Class: Rootage::SyslogLogger

Inherits:
Logger
  • Object
show all
Defined in:
lib/rootage/log.rb

Overview

SyslogLogger is a logger using syslog("syslog-logger" gem).

Instance Method Summary collapse

Methods inherited from Logger

#level, of, register

Constructor Details

#initializeSyslogLogger

Returns a new instance of SyslogLogger.



191
192
193
# File 'lib/rootage/log.rb', line 191

def initialize
  @logger = ::Logger::Syslog.new('pione')
end

Instance Method Details

#debug(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object



208
# File 'lib/rootage/log.rb', line 208

def debug(msg, pos=caller(1).first, pid=Process.pid); @logger.debug(msg); end

#error(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object



205
# File 'lib/rootage/log.rb', line 205

def error(msg, pos=caller(1).first, pid=Process.pid); @logger.error(msg); end

#fatal(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object



204
# File 'lib/rootage/log.rb', line 204

def fatal(msg, pos=caller(1).first, pid=Process.pid); @logger.fatal(msg); end

#info(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object



207
# File 'lib/rootage/log.rb', line 207

def info (msg, pos=caller(1).first, pid=Process.pid); @logger.info(msg) ; end

#level=(lv) ⇒ Object



195
196
197
198
199
200
201
202
# File 'lib/rootage/log.rb', line 195

def level=(lv)
  case lv
  when :fatal, :error, :warn, :info, :debug
    @logger.level = lv
  else
    raise UnknownLogLevel.new(self.class, :level=, lv)
  end
end

#queued?Boolean

Returns:

  • (Boolean)


214
215
216
# File 'lib/rootage/log.rb', line 214

def queued?
  false
end

#terminateObject



210
211
212
# File 'lib/rootage/log.rb', line 210

def terminate
  # ignore
end

#warn(msg, pos = caller(1).first, pid = Process.pid) ⇒ Object



206
# File 'lib/rootage/log.rb', line 206

def warn (msg, pos=caller(1).first, pid=Process.pid); @logger.warn(msg) ; end