Class: LogStruct::Configuration
- Inherits:
-
T::Struct
- Object
- T::Struct
- LogStruct::Configuration
- Extended by:
- T::Sig
- Includes:
- Sorbet::SerializeSymbolKeys
- Defined in:
- lib/log_struct/configuration.rb
Overview
Core configuration class that provides a type-safe API
Instance Attribute Summary collapse
-
#enabled ⇒ Boolean
------------------------------------------------------------------------------------- Props -------------------------------------------------------------------------------------.
-
#enabled_environments ⇒ Array<Symbol>
Returns the value of prop
enabled_environments
. -
#error_handling_modes ⇒ ConfigStruct::ErrorHandlingModes
readonly
How to handle errors from various sources.
-
#error_reporting_handler ⇒ Handlers::ErrorReporter?
Custom handler for error reporting Default: Errors are handled by MultiErrorReporter (auto-detects Sentry, Bugsnag, Rollbar, Honeybadger, etc.).
-
#filters ⇒ ConfigStruct::Filters
readonly
Returns the value of prop
filters
. -
#integrations ⇒ ConfigStruct::Integrations
readonly
Returns the value of prop
integrations
. -
#local_environments ⇒ Array<Symbol>
Returns the value of prop
local_environments
. -
#string_scrubbing_handler ⇒ Handlers::StringScrubber?
Custom log scrubbing handler for any additional string scrubbing Default: nil.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Sorbet::SerializeSymbolKeys
Constructor Details
#initialize(enabled: true, enabled_environments:, local_environments:, integrations:, filters:, string_scrubbing_handler: nil, error_reporting_handler: nil, error_handling_modes:) ⇒ void
|
# File '' prop :enabled, T::Boolean, default: true prop :enabled_environments, T::Array[Symbol], factory: -> { [:test, :production] } prop :local_environments, T::Array[Symbol], factory: -> { [:development, :test] } const :integrations, ConfigStruct::Integrations, factory: -> { ConfigStruct::Integrations.new } const :filters, ConfigStruct::Filters, factory: -> { ConfigStruct::Filters.new } prop :string_scrubbing_handler, T.nilable(Handlers::StringScrubber) prop :error_reporting_handler, T.nilable(Handlers::ErrorReporter), default: nil const :error_handling_modes, ConfigStruct::ErrorHandlingModes, factory: -> { ConfigStruct::ErrorHandlingModes.new } |
Instance Attribute Details
#enabled ⇒ Boolean
Props
|
# File '' prop :enabled, T::Boolean, default: true |
#enabled_environments ⇒ Array<Symbol>
Returns the value of prop enabled_environments
.
|
# File '' prop :enabled_environments, T::Array[Symbol], factory: -> { [:test, :production] } |
#error_handling_modes ⇒ ConfigStruct::ErrorHandlingModes (readonly)
How to handle errors from various sources
|
# File '' const :error_handling_modes, ConfigStruct::ErrorHandlingModes, factory: -> { ConfigStruct::ErrorHandlingModes.new } |
#error_reporting_handler ⇒ Handlers::ErrorReporter?
Custom handler for error reporting Default: Errors are handled by MultiErrorReporter (auto-detects Sentry, Bugsnag, Rollbar, Honeybadger, etc.)
|
# File '' prop :error_reporting_handler, T.nilable(Handlers::ErrorReporter), default: nil |
#filters ⇒ ConfigStruct::Filters (readonly)
Returns the value of prop filters
.
|
# File '' const :filters, ConfigStruct::Filters, factory: -> { ConfigStruct::Filters.new } |
#integrations ⇒ ConfigStruct::Integrations (readonly)
Returns the value of prop integrations
.
|
# File '' const :integrations, ConfigStruct::Integrations, factory: -> { ConfigStruct::Integrations.new } |
#local_environments ⇒ Array<Symbol>
Returns the value of prop local_environments
.
|
# File '' prop :local_environments, T::Array[Symbol], factory: -> { [:development, :test] } |
#string_scrubbing_handler ⇒ Handlers::StringScrubber?
Custom log scrubbing handler for any additional string scrubbing Default: nil
|
# File '' prop :string_scrubbing_handler, T.nilable(Handlers::StringScrubber) |
Class Method Details
.instance ⇒ Configuration
50 51 52 |
# File 'lib/log_struct/configuration.rb', line 50 def self.instance @instance ||= T.let(Configuration.new, T.nilable(Configuration)) end |
.set_instance(config) ⇒ void
This method returns an undefined value.
55 56 57 |
# File 'lib/log_struct/configuration.rb', line 55 def self.set_instance(config) @instance = config end |