Class: Malevich::Kernel
Instance Attribute Summary collapse
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#dsl ⇒ Object
readonly
Returns the value of attribute dsl.
-
#monitor ⇒ Object
readonly
Returns the value of attribute monitor.
-
#ohai ⇒ Object
readonly
Returns the value of attribute ohai.
-
#plugins ⇒ Object
readonly
Returns the value of attribute plugins.
-
#riemann_events ⇒ Object
readonly
Returns the value of attribute riemann_events.
Instance Method Summary collapse
-
#initialize ⇒ Kernel
constructor
A new instance of Kernel.
- #log(level = :info, message) ⇒ Object
- #log_level=(level = 'INFO') ⇒ Object
- #test_plugin(file) ⇒ Object
Methods included from Loader
#find_plugin, #load_plugins, #load_responders
Constructor Details
#initialize ⇒ Kernel
Returns a new instance of Kernel.
10 11 12 13 14 15 16 17 |
# File 'lib/malevich.rb', line 10 def initialize @config = Malevich::Hashie.new # for config from file @cmd = Malevich::Hashie.new @plugins = Malevich::Hashie.new # for plugin containers (errors, settings) @logger = Logger.new(STDOUT) @monitor = Malevich::Monitor.new @riemann_events = ::Queue.new end |
Instance Attribute Details
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
8 9 10 |
# File 'lib/malevich.rb', line 8 def cmd @cmd end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/malevich.rb', line 8 def config @config end |
#dsl ⇒ Object (readonly)
Returns the value of attribute dsl.
8 9 10 |
# File 'lib/malevich.rb', line 8 def dsl @dsl end |
#monitor ⇒ Object (readonly)
Returns the value of attribute monitor.
8 9 10 |
# File 'lib/malevich.rb', line 8 def monitor @monitor end |
#ohai ⇒ Object (readonly)
Returns the value of attribute ohai.
8 9 10 |
# File 'lib/malevich.rb', line 8 def ohai @ohai end |
#plugins ⇒ Object (readonly)
Returns the value of attribute plugins.
8 9 10 |
# File 'lib/malevich.rb', line 8 def plugins @plugins end |
#riemann_events ⇒ Object (readonly)
Returns the value of attribute riemann_events.
8 9 10 |
# File 'lib/malevich.rb', line 8 def riemann_events @riemann_events end |
Instance Method Details
#log(level = :info, message) ⇒ Object
25 26 27 |
# File 'lib/malevich.rb', line 25 def log(level = :info, ) @logger.send(level.to_sym, ) end |
#log_level=(level = 'INFO') ⇒ Object
29 30 31 |
# File 'lib/malevich.rb', line 29 def log_level=(level = 'INFO') @logger.level = Logger.const_get(level) end |