Sha256: a75dab5ca16e5274089b33a9e79f7ce28280dfcbe747d00eda0c8f399aac894a

Contents?: true

Size: 729 Bytes

Versions: 3

Compression:

Stored size: 729 Bytes

Contents

module Crystal
  module Processors
    class ConveyorLogger < Processor            
      def call
        begin
          next_processor.call
          
          # if workspace.trace?
          #   total_time = workspace.trace.inject(0){|memo, pair| memo += pair.last}
          #   max_pair = workspace.trace.max_by{|pair| pair.last}
          #   logger.info "Completed in #{(total_time * 1000).round} ms (#{(max_pair.last * 1000).round} ms taken by #{max_pair.first})\n\n"
          # else
          logger.info "Completed in ? ms\n\n"
          # end
        rescue StandardError => e
          raise e if config.test?
            
          logger.error e
          logger.info "\n"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
crystal-0.0.13 lib/crystal/conveyor/processors/conveyor_logger.rb
crystal-0.0.12 lib/crystal/conveyor/processors/conveyor_logger.rb
crystal_ext-0.0.11 lib/crystal/conveyor/processors/conveyor_logger.rb