Class: Ichnite::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/ichnite/logger.rb

Direct Known Subclasses

TestLogger

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ Logger

Returns a new instance of Logger.



5
6
7
8
# File 'lib/ichnite/logger.rb', line 5

def initialize(logger)
  @logger = logger
  @formatter = Formatters::KeyValue.new
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



3
4
5
# File 'lib/ichnite/logger.rb', line 3

def logger
  @logger
end

Instance Method Details

#log(event, opts = {}) ⇒ Object



10
11
12
# File 'lib/ichnite/logger.rb', line 10

def log(event, opts = {})
  emit(Ichnite.context(event).merge(opts))
end