Sha256: 28bf421bb3966455532ea156821040df16a1b510bf1de8e30a666f693ef2efc8

Contents?: true

Size: 573 Bytes

Versions: 12

Compression:

Stored size: 573 Bytes

Contents

require 'logger'

module GeneValidatorApp
  class Logger < Logger
    def initialize(dev, verbose = false)
      super dev
      self.level     = verbose ? DEBUG : INFO
      self.formatter = Formatter.new
    end

    # We change Logging format so that it is consistent with Sinatra's
    class Formatter < Formatter
      Format = "[%s] %s  %s\n"

      def initialize
        self.datetime_format = '%Y-%m-%d %H:%M:%S'
      end

      def call(severity, time, _progname, msg)
        Format % [format_datetime(time), severity, msg2str(msg)]
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
genevalidatorapp-2.1.1 lib/genevalidatorapp/logger.rb
genevalidatorapp-2.1.0 lib/genevalidatorapp/logger.rb
genevalidatorapp-2.0.2 lib/genevalidatorapp/logger.rb
genevalidatorapp-2.0.1 lib/genevalidatorapp/logger.rb
genevalidatorapp-2.0.0 lib/genevalidatorapp/logger.rb
genevalidatorapp-1.5.4 lib/genevalidatorapp/logger.rb
genevalidatorapp-1.5.3 lib/genevalidatorapp/logger.rb
genevalidatorapp-1.5.2 lib/genevalidatorapp/logger.rb
genevalidatorapp-1.5.1 lib/genevalidatorapp/logger.rb
genevalidatorapp-1.5.0 lib/genevalidatorapp/logger.rb
genevalidatorapp-1.4.13 lib/GeneValidatorApp/logger.rb
genevalidatorapp-1.4.12 lib/GeneValidatorApp/logger.rb