Module: Msgr::Logging

Included in:
Binding, Channel, Client, Connection, Consumer, Dispatcher, Routes
Defined in:
lib/msgr/logging.rb

Instance Method Summary collapse

Instance Method Details

#log(level) ⇒ Object


5
6
7
# File 'lib/msgr/logging.rb', line 5

def log(level)
  Msgr.logger.send(level) { "#{log_name} #{yield}" } if Msgr.logger
end

#log_nameObject


9
10
11
# File 'lib/msgr/logging.rb', line 9

def log_name
  "[#{Thread.current.object_id.to_s(16)}]"
end