Module: Restify::Logging

Included in:
Adapter::PooledEM, Adapter::PooledEM::Pool, Adapter::Typhoeus
Defined in:
lib/restify/logging.rb

Instance Method Summary collapse

Instance Method Details

#_fmt(**kwargs) ⇒ Object



26
27
28
# File 'lib/restify/logging.rb', line 26

def _fmt(**kwargs)
  kwargs.each.map {|k, v| "#{k}=#{v}" }.join(' ')
end

#_log_prefixObject



22
23
24
# File 'lib/restify/logging.rb', line 22

def _log_prefix
  nil
end

#debug(message = nil, tag: nil, **kwargs) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/restify/logging.rb', line 11

def debug(message = nil, tag: nil, **kwargs)
  logger.debug do
    [
      _log_prefix,
      *Array(tag),
      message,
      _fmt(**kwargs)
    ].map(&:to_s).reject(&:empty?).join(' ')
  end
end

#loggerObject



7
8
9
# File 'lib/restify/logging.rb', line 7

def logger
  @logger ||= ::Logging.logger[self]
end