Class: RigorLogger::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rigor_logger/base.rb

Direct Known Subclasses

Event, Metric

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Base

Returns a new instance of Base.

Raises:



10
11
12
13
14
15
16
17
# File 'lib/rigor_logger/base.rb', line 10

def initialize name, options={}
  raise(ConfigurationError, 'Please provide an API key!') unless RigorLogger.config[:api_key]
  @host        = options[:host] || RigorLogger.config[:host]
  @environment = options[:environment] || RigorLogger.config[:environment]
  @app         = options[:app] || RigorLogger.config[:app]
  @name        = name
  @options     = set_options(options)
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



8
9
10
# File 'lib/rigor_logger/base.rb', line 8

def app
  @app
end

#environmentObject (readonly)

Returns the value of attribute environment.



8
9
10
# File 'lib/rigor_logger/base.rb', line 8

def environment
  @environment
end

#hostObject (readonly)

Returns the value of attribute host.



8
9
10
# File 'lib/rigor_logger/base.rb', line 8

def host
  @host
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/rigor_logger/base.rb', line 8

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/rigor_logger/base.rb', line 8

def options
  @options
end