Sha256: 2d05eb417cf3b3ed6dd8f5d39f403cfed3d87921d68db1fb0f91069f2ef5bef8
Contents?: true
Size: 569 Bytes
Versions: 30
Compression:
Stored size: 569 Bytes
Contents
require 'syslog' require 'syslog/logger' class WdLogger < Logger SYSLOG_NAME = 'sys_watchdog' def initialize *args @syslog = Syslog::Logger.new SYSLOG_NAME super end def add(severity, message = nil, progname = nil, &block) super if message.nil? if block_given? message = yield else message = progname end end added severity, message end def added severity, message if severity >= Logger::WARN @syslog.send Logger::Severity::constants[severity].downcase, message end end end
Version data entries
30 entries across 30 versions & 1 rubygems