Class: Loga::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/loga/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/loga/configuration.rb', line 18

def initialize
  @host              = gethostname
  @device            = nil
  @sync              = true
  @level             = :info
  @filter_parameters = []
  @service_version   = :git

  # Rails specific configuration
  @enabled           = true
  @silence_rails_rack_logger = true
end

Instance Attribute Details

#deviceObject

Returns the value of attribute device.



6
7
8
# File 'lib/loga/configuration.rb', line 6

def device
  @device
end

#enabledObject

Returns the value of attribute enabled.



6
7
8
# File 'lib/loga/configuration.rb', line 6

def enabled
  @enabled
end

#filter_parametersObject

Returns the value of attribute filter_parameters.



6
7
8
# File 'lib/loga/configuration.rb', line 6

def filter_parameters
  @filter_parameters
end

#hostObject

Returns the value of attribute host.



6
7
8
# File 'lib/loga/configuration.rb', line 6

def host
  @host
end

#levelObject

Returns the value of attribute level.



6
7
8
# File 'lib/loga/configuration.rb', line 6

def level
  @level
end

#loggerObject (readonly)

Returns the value of attribute logger.



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

def logger
  @logger
end

#service_nameObject

Returns the value of attribute service_name.



6
7
8
# File 'lib/loga/configuration.rb', line 6

def service_name
  @service_name
end

#service_versionObject

Returns the value of attribute service_version.



6
7
8
# File 'lib/loga/configuration.rb', line 6

def service_version
  @service_version
end

#silence_rails_rack_loggerObject

Returns the value of attribute silence_rails_rack_logger.



6
7
8
# File 'lib/loga/configuration.rb', line 6

def silence_rails_rack_logger
  @silence_rails_rack_logger
end

#syncObject

Returns the value of attribute sync.



6
7
8
# File 'lib/loga/configuration.rb', line 6

def sync
  @sync
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



38
39
40
# File 'lib/loga/configuration.rb', line 38

def configure
  yield self
end

#initialize!Object



31
32
33
34
35
36
# File 'lib/loga/configuration.rb', line 31

def initialize!
  @service_name = service_name.to_s.strip
  @service_version = compute_service_version

  initialize_logger
end