class Console::Compatible::Logger
A compatible interface for {::Logger} which can be used with {Console}.
def add(severity, message = nil, progname = nil)
def add(severity, message = nil, progname = nil) severity ||= UNKNOWN if @logdev.nil? or severity < level return true end if progname.nil? progname = @progname end if message.nil? if block_given? message = yield else message = progname progname = @progname end end @logdev.call( progname, message, severity: format_severity(severity) ) return true end
def format_severity(value)
def format_severity(value) super.downcase.to_sym end
def initialize(subject, output = Console)
def initialize(subject, output = Console) super(nil) @progname = subject @logdev = LogDevice.new(subject, output) end