Class: Loggie::Configuration

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_includedObject

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_filesObject

Returns the value of attribute log_files.



15
16
17
# File 'lib/loggie/configuration.rb', line 15

def log_files
  @log_files
end

#log_levelObject

Returns the value of attribute log_level.



17
18
19
# File 'lib/loggie/configuration.rb', line 17

def log_level
  @log_level
end

#max_retryObject

Returns the value of attribute max_retry.



16
17
18
# File 'lib/loggie/configuration.rb', line 16

def max_retry
  @max_retry
end

#read_tokenObject

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_secondsObject

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

Returns:

  • (Boolean)


31
32
33
# File 'lib/loggie/configuration.rb', line 31

def valid?
  sleep_before_retry_seconds.to_f < MAX_RETRY_DELEY_SECONDS
end