Class: Philotic::Logging::Logger
- Inherits:
-
Logger
- Object
- Logger
- Philotic::Logging::Logger
- Defined in:
- lib/philotic/logging/logger.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
- #message_class ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
9 10 11 |
# File 'lib/philotic/logging/logger.rb', line 9 def connection @connection end |
Instance Method Details
#add(severity, message = nil, progname = nil) ⇒ Object Also known as: log
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/philotic/logging/logger.rb', line 15 def add(severity, = nil, progname = nil) severity ||= UNKNOWN if @logdev.nil? or severity < @level return true end progname ||= @progname if .nil? if block_given? = yield else = progname progname = @progname end end @logdev.write((format_severity(severity), Time.now, progname, )) begin = .new(severity, , progname) connection.publish if connection rescue => e @logdev.write((format_severity(Logger::ERROR), Time.now, progname, e.)) end true end |