Class: HTTParty::Logger::ApacheFormatter

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

Overview

:nodoc:

Constant Summary collapse

TAG_NAME =
HTTParty.name

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger, level) ⇒ ApacheFormatter

Returns a new instance of ApacheFormatter.



8
9
10
11
# File 'lib/httparty/logger/apache_formatter.rb', line 8

def initialize(logger, level)
  @logger = logger
  @level  = level.to_sym
end

Instance Attribute Details

#levelObject

Returns the value of attribute level.



6
7
8
# File 'lib/httparty/logger/apache_formatter.rb', line 6

def level
  @level
end

#loggerObject

Returns the value of attribute logger.



6
7
8
# File 'lib/httparty/logger/apache_formatter.rb', line 6

def logger
  @logger
end

Instance Method Details

#format(request, response) ⇒ Object



13
14
15
16
17
18
# File 'lib/httparty/logger/apache_formatter.rb', line 13

def format(request, response)
  @request = request
  @response = response

  logger.public_send level, message
end