Class: Wildsight::Context::Logger
- Inherits:
-
Logger
- Object
- Logger
- Wildsight::Context::Logger
- Defined in:
- lib/wildsight/context/logger.rb
Instance Method Summary collapse
- #call(severity, time, progname, msg) ⇒ Object
- #close ⇒ Object
-
#initialize(context = nil) ⇒ Logger
constructor
A new instance of Logger.
- #write(message) ⇒ Object
Constructor Details
#initialize(context = nil) ⇒ Logger
Returns a new instance of Logger.
8 9 10 11 12 |
# File 'lib/wildsight/context/logger.rb', line 8 def initialize(context = nil) @context = context super(self) self.formatter = self end |
Instance Method Details
#call(severity, time, progname, msg) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/wildsight/context/logger.rb', line 14 def call(severity, time, progname, msg) payload = { :severity => severity, :facility => progname, :message => msg.to_s.strip } context = @context || Wildsight::Context.detect context.event(:log, payload, {}) if context return nil end |
#close ⇒ Object
28 29 |
# File 'lib/wildsight/context/logger.rb', line 28 def close end |
#write(message) ⇒ Object
25 26 |
# File 'lib/wildsight/context/logger.rb', line 25 def write() end |