Class: ZuoraObservability::Configuration
- Inherits:
-
Object
- Object
- ZuoraObservability::Configuration
- Defined in:
- lib/zuora_observability/configuration.rb
Overview
Global configuration that can be set in a Rails initializer
Instance Attribute Summary collapse
-
#custom_payload_hooks ⇒ Object
readonly
Returns the value of attribute custom_payload_hooks.
-
#json_logging ⇒ Object
Returns the value of attribute json_logging.
-
#zecs_service_hook ⇒ Object
Returns the value of attribute zecs_service_hook.
Instance Method Summary collapse
- #add_custom_payload_hook(&block) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 |
# File 'lib/zuora_observability/configuration.rb', line 9 def initialize @custom_payload_hooks = [] @zecs_service_hook = nil # NOTE(hartley): this checks the var for presence rather than value to # align with how Rails does RAILS_LOG_TO_STDOUT @json_logging = ENV['ZUORA_JSON_LOGGING'].present? ? true : !(Rails.env.development? || Rails.env.test?) end |
Instance Attribute Details
#custom_payload_hooks ⇒ Object (readonly)
Returns the value of attribute custom_payload_hooks.
6 7 8 |
# File 'lib/zuora_observability/configuration.rb', line 6 def custom_payload_hooks @custom_payload_hooks end |
#json_logging ⇒ Object
Returns the value of attribute json_logging.
7 8 9 |
# File 'lib/zuora_observability/configuration.rb', line 7 def json_logging @json_logging end |
#zecs_service_hook ⇒ Object
Returns the value of attribute zecs_service_hook.
7 8 9 |
# File 'lib/zuora_observability/configuration.rb', line 7 def zecs_service_hook @zecs_service_hook end |
Instance Method Details
#add_custom_payload_hook(&block) ⇒ Object
17 18 19 |
# File 'lib/zuora_observability/configuration.rb', line 17 def add_custom_payload_hook(&block) custom_payload_hooks << block end |