class Pantheios::Services::SimpleConsoleLogService

A class that fulfils the Pantheios LogService protocol that allows all severities and logs to the console (via +$stdout+ and +$stderr+)

NOTE: The LogService protocol is implemented by a class that provides the instance methods +severity_logged?(severity : Object) : boolean+ and +log(severity : Object, t : Time, prefix : String|Array, msg : String)+

Public Instance Methods

infer_stream(sev) click to toggle source

Overrideable method that determines which stream to write, based on a severity. This implementation always returns +$stderr+

Overrides must return an object that supports the +puts(String)+ method

# File lib/pantheios/services/simple_console_log_service.rb, line 80
def infer_stream sev

        $stderr
end
log(sev, t, pref, msg) click to toggle source
# File lib/pantheios/services/simple_console_log_service.rb, line 68
def log sev, t, pref, msg

        stm = infer_stream sev

        stm.puts "#{pref}#{msg}"
end
severity_logged?(severity) click to toggle source
# File lib/pantheios/services/simple_console_log_service.rb, line 63
def severity_logged? severity

        true
end