Class: Loggie::Configuration
- Inherits:
-
Object
- Object
- Loggie::Configuration
- Defined in:
- lib/loggie/configuration.rb
Constant Summary collapse
- MAX_RETRY_DELEY_SECONDS =
max 20 seconds, or it will expire
20.0
Instance Attribute Summary collapse
-
#default_fields_included ⇒ Object
Returns the value of attribute default_fields_included.
-
#log_files ⇒ Object
Returns the value of attribute log_files.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#max_retry ⇒ Object
Returns the value of attribute max_retry.
-
#read_token ⇒ Object
Returns the value of attribute read_token.
-
#sleep_before_retry_seconds ⇒ Object
Returns the value of attribute sleep_before_retry_seconds.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
21 22 23 24 25 26 27 28 29 |
# File 'lib/loggie/configuration.rb', line 21 def initialize @max_retry = 50 @log_level = :fatal @sleep_before_retry_seconds = 0.5 @default_fields_included = [ "request_method", "path_info", "query_string", "agent", "authorization", "response_body", "request_params" ] end |
Instance Attribute Details
#default_fields_included ⇒ Object
Returns the value of attribute default_fields_included.
19 20 21 |
# File 'lib/loggie/configuration.rb', line 19 def default_fields_included @default_fields_included end |
#log_files ⇒ Object
Returns the value of attribute log_files.
15 16 17 |
# File 'lib/loggie/configuration.rb', line 15 def log_files @log_files end |
#log_level ⇒ Object
Returns the value of attribute log_level.
17 18 19 |
# File 'lib/loggie/configuration.rb', line 17 def log_level @log_level end |
#max_retry ⇒ Object
Returns the value of attribute max_retry.
16 17 18 |
# File 'lib/loggie/configuration.rb', line 16 def max_retry @max_retry end |
#read_token ⇒ Object
Returns the value of attribute read_token.
14 15 16 |
# File 'lib/loggie/configuration.rb', line 14 def read_token @read_token end |
#sleep_before_retry_seconds ⇒ Object
Returns the value of attribute sleep_before_retry_seconds.
18 19 20 |
# File 'lib/loggie/configuration.rb', line 18 def sleep_before_retry_seconds @sleep_before_retry_seconds end |
Instance Method Details
#valid? ⇒ Boolean
31 32 33 |
# File 'lib/loggie/configuration.rb', line 31 def valid? sleep_before_retry_seconds.to_f < MAX_RETRY_DELEY_SECONDS end |