def run!
      if @output_file.nil?
        @output = $stdout
      else
        @output = File.new(@output_file, 'a')
      end

      @sources.each do |source|
        if source.is_a?(String) && File.exist?(source)
          process_file(source)
        elsif source.is_a?(IO)
          process_io(source)
        elsif ['-', 'STDIN'].include?(source)
          process_io($stdin)
        end
      end

    ensure
      @output.close if @output.is_a?(File)
    end
def run!
      if @output_file.nil?
        @output = $stdout
      else
        @output = File.new(@output_file, 'a')
      end

      @sources.each do |source|
        if source.is_a?(String) && File.exist?(source)
          process_file(source)
        elsif source.is_a?(IO)
          process_io(source)
        elsif ['-', 'STDIN'].include?(source)
          process_io($stdin)
        end
      end

    ensure
      @output.close if @output.is_a?(File)
    end
Runs the log processing by setting up the output stream and iterating over all the
 input sources. Input sources can either be filenames (String instances) or IO streams
 (IO instances). The strings "-" and "STDIN" will be substituted for the $stdin variable.