Class: Sensu::Base
- Inherits:
-
Object
- Object
- Sensu::Base
- Defined in:
- lib/sensu/base.rb
Instance Method Summary collapse
- #extensions ⇒ Object
-
#initialize(options = {}) ⇒ Base
constructor
A new instance of Base.
- #logger ⇒ Object
- #settings ⇒ Object
- #setup_process ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Base
Returns a new instance of Base.
21 22 23 |
# File 'lib/sensu/base.rb', line 21 def initialize(={}) @options = DEFAULT_OPTIONS.merge() end |
Instance Method Details
#extensions ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/sensu/base.rb', line 45 def extensions extensions = Extensions.new if @options[:extension_dir] extensions.require_directory(@options[:extension_dir]) end extensions.load_all extensions end |
#logger ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/sensu/base.rb', line 25 def logger stream = LogStream.new stream.level = @options[:log_level] if @options[:log_file] stream.reopen(@options[:log_file]) end stream.setup_traps stream.logger end |