Class: PaypalServerSdk::ResponseLoggingConfiguration

Inherits:
CoreLibrary::ApiResponseLoggingConfiguration
  • Object
show all
Defined in:
lib/paypal_server_sdk/logging/configuration/api_logging_configuration.rb

Overview

Initializes a new instance of ResponseLoggingConfiguration.

Instance Method Summary collapse

Constructor Details

#initialize(log_body: false, log_headers: false, headers_to_include: nil, headers_to_exclude: nil, headers_to_unmask: nil) ⇒ ResponseLoggingConfiguration

Returns a new instance of ResponseLoggingConfiguration.

Parameters:

  • log_body (Boolean) (defaults to: false)

    Indicates whether the message body should be logged. Default is false.

  • log_headers (Boolean) (defaults to: false)

    Indicates whether the message headers should be logged. Default is false.

  • headers_to_exclude (Array<String>) (defaults to: nil)

    Array of headers not displayed in logging. Default is an empty array.

  • headers_to_include (Array<String>) (defaults to: nil)

    Array of headers to be displayed in logging. Default is an empty array.

  • headers_to_unmask (Array<String>) (defaults to: nil)

    Array of headers which values are non-sensitive to display in logging. Default is an empty array.



53
54
55
56
57
58
59
60
61
62
# File 'lib/paypal_server_sdk/logging/configuration/api_logging_configuration.rb', line 53

def initialize(log_body: false, log_headers: false, headers_to_include: nil,
               headers_to_exclude: nil, headers_to_unmask: nil)
  super(
    log_body,
    log_headers,
    headers_to_exclude,
    headers_to_include,
    headers_to_unmask
  )
end

Instance Method Details

#clone_with(log_body: nil, log_headers: nil, headers_to_include: nil, headers_to_exclude: nil, headers_to_unmask: nil) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/paypal_server_sdk/logging/configuration/api_logging_configuration.rb', line 64

def clone_with(log_body: nil, log_headers: nil, headers_to_include: nil,
               headers_to_exclude: nil, headers_to_unmask: nil)
  log_body ||= self.log_body
  log_headers ||= self.log_headers
  headers_to_include ||= self.headers_to_include
  headers_to_exclude ||= self.headers_to_exclude
  headers_to_unmask ||= self.headers_to_unmask

  ResponseLoggingConfiguration.new(log_body: log_body, log_headers: log_headers,
                                   headers_to_include: headers_to_include,
                                   headers_to_exclude: headers_to_exclude,
                                   headers_to_unmask: headers_to_unmask)
end