Module: HTTPX::Loggable

Included in:
Channel, Channel::HTTP1, Channel::HTTP2, Client, TCP
Defined in:
lib/httpx/loggable.rb

Instance Method Summary collapse

Instance Method Details

#log(level = @options.debug_level, label = "", &msg) ⇒ Object



5
6
7
8
9
# File 'lib/httpx/loggable.rb', line 5

def log(level = @options.debug_level, label = "", &msg)
  return unless @options.debug
  return unless @options.debug_level >= level
  @options.debug << (+label << msg.call << "\n")
end