Class: Dexter::LogSource
- Inherits:
-
Object
- Object
- Dexter::LogSource
- Defined in:
- lib/dexter/sources/log_source.rb
Instance Method Summary collapse
-
#initialize(logfile, input_format) ⇒ LogSource
constructor
A new instance of LogSource.
- #perform(collector) ⇒ Object
- #stdin? ⇒ Boolean
Constructor Details
#initialize(logfile, input_format) ⇒ LogSource
Returns a new instance of LogSource.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/dexter/sources/log_source.rb', line 3 def initialize(logfile, input_format) @log_parser = case input_format when "csv" CsvLogParser.new(logfile) when "json" JsonLogParser.new(logfile) when "sql" SqlLogParser.new(logfile) else StderrLogParser.new(logfile) end @stdin = logfile == STDIN end |
Instance Method Details
#perform(collector) ⇒ Object
18 19 20 |
# File 'lib/dexter/sources/log_source.rb', line 18 def perform(collector) @log_parser.perform(collector) end |
#stdin? ⇒ Boolean
22 23 24 |
# File 'lib/dexter/sources/log_source.rb', line 22 def stdin? @stdin end |