Class: HttpLog::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/httplog/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/httplog/configuration.rb', line 24

def initialize
  @enabled               = true
  @compact_log           = false
  @logger                = Logger.new($stdout)
  @severity              = Logger::Severity::DEBUG
  @prefix                = LOG_PREFIX
  @log_connect           = true
  @log_request           = true
  @log_headers           = false
  @log_data              = true
  @log_status            = true
  @log_response          = true
  @log_benchmark         = true
  @url_whitelist_pattern = /.*/
  @url_blacklist_pattern = nil
  @color                 = false
  @prefix_data_lines     = false
  @prefix_response_lines = false
  @prefix_line_numbers   = false
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def color
  @color
end

#compact_logObject

Returns the value of attribute compact_log.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def compact_log
  @compact_log
end

#enabledObject

Returns the value of attribute enabled.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def enabled
  @enabled
end

#log_benchmarkObject

Returns the value of attribute log_benchmark.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def log_benchmark
  @log_benchmark
end

#log_connectObject

Returns the value of attribute log_connect.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def log_connect
  @log_connect
end

#log_dataObject

Returns the value of attribute log_data.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def log_data
  @log_data
end

#log_headersObject

Returns the value of attribute log_headers.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def log_headers
  @log_headers
end

#log_requestObject

Returns the value of attribute log_request.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def log_request
  @log_request
end

#log_responseObject

Returns the value of attribute log_response.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def log_response
  @log_response
end

#log_statusObject

Returns the value of attribute log_status.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def log_status
  @log_status
end

#loggerObject

Returns the value of attribute logger.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def logger
  @logger
end

#prefixObject

Returns the value of attribute prefix.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def prefix
  @prefix
end

#prefix_data_linesObject

Returns the value of attribute prefix_data_lines.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def prefix_data_lines
  @prefix_data_lines
end

#prefix_line_numbersObject

Returns the value of attribute prefix_line_numbers.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def prefix_line_numbers
  @prefix_line_numbers
end

#prefix_response_linesObject

Returns the value of attribute prefix_response_lines.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def prefix_response_lines
  @prefix_response_lines
end

#severityObject

Returns the value of attribute severity.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def severity
  @severity
end

#url_blacklist_patternObject

Returns the value of attribute url_blacklist_pattern.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def url_blacklist_pattern
  @url_blacklist_pattern
end

#url_whitelist_patternObject

Returns the value of attribute url_whitelist_pattern.



5
6
7
# File 'lib/httplog/configuration.rb', line 5

def url_whitelist_pattern
  @url_whitelist_pattern
end

Instance Method Details

#[]=(key, value) ⇒ Object

TODO: remove in 1.0.0



46
47
48
49
# File 'lib/httplog/configuration.rb', line 46

def []=(key, value)
  warn 'DEPRECATION WARNING: Assignment to HttpLog.options will be removed in version 1.0.0. Please use HttpLog.configure block instead as described here: https://github.com/trusche/httplog#configuration'
  send("#{key}=", value)
end