Class: LogMagic::BaseExplainer
- Inherits:
-
Object
- Object
- LogMagic::BaseExplainer
- Includes:
- JSONUtils, TemplatingUtils
- Defined in:
- lib/log_magic/explainers/base_explainer.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize ⇒ BaseExplainer
constructor
A new instance of BaseExplainer.
- #start ⇒ Object
Methods included from TemplatingUtils
#enriche, #match_regex, #rendered_template, #template_dir, #template_name, #template_path
Methods included from JSONUtils
#parse_json, #pretty_print_json, #query_hash
Constructor Details
#initialize ⇒ BaseExplainer
Returns a new instance of BaseExplainer.
5 6 7 |
# File 'lib/log_magic/explainers/base_explainer.rb', line 5 def initialize @persistance_layer = ::LogMagic::PersistanceLayer.new end |
Instance Method Details
#start ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/log_magic/explainers/base_explainer.rb', line 10 def start app = Proc.new do |env| @uuid = env['PATH_INFO'][1..-1] body = rendered_template ['200', {'Content-Type' => 'text/html', 'Content-Length' => body.length.to_s}, [body]] end Rack::Handler::WEBrick.run app, Port: self.class.port_number, Logger: WEBrick::Log::new('/tmp/log_magic.log') end |