Class: Fluent::Auditify::SyntaxChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/auditify/syntax_checker.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ SyntaxChecker



8
9
10
11
12
13
14
# File 'lib/fluent/auditify/syntax_checker.rb', line 8

def initialize(options={})
  log_options = {
    log_level: options[:log_level] || Logger::INFO,
    color: options[:color]
  }
  @logger = Fluent::Auditify::Log.new(log_options)
end

Instance Method Details

#run(options = {}) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/fluent/auditify/syntax_checker.rb', line 16

def run(options={})
  if options[:mask_only]
    @manager = Fluent::Auditify::PluginManager.new(@logger, mask_only: true)
    @manager.dispatch(options)
  else
    @manager = Fluent::Auditify::PluginManager.new(@logger)
    @manager.dispatch(options)
    # instance
    @manager.report(:console)
  end
  true
end