Sha256: 0232133b94a24b1bc3d220de2a0ebf58cfece5e77e6b7d0cd0507cccf8497112

Contents?: true

Size: 463 Bytes

Versions: 13

Compression:

Stored size: 463 Bytes

Contents

require 'logger'

module Terraspace
  class Logger < ::Logger
    def initialize(*args)
      super
      self.formatter = Formatter.new
      self.level = :info
    end

    def format_message(severity, datetime, progname, msg)
      line = if @logdev.dev == $stdout || @logdev.dev == $stderr
        msg # super simple format if stdout
      else
        super # use the configured formatter
      end
      line =~ /\n$/ ? line : "#{line}\n"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
terraspace-0.5.12 lib/terraspace/logger.rb
terraspace-0.5.11 lib/terraspace/logger.rb
terraspace-0.5.10 lib/terraspace/logger.rb
terraspace-0.5.9 lib/terraspace/logger.rb
terraspace-0.5.8 lib/terraspace/logger.rb
terraspace-0.5.7 lib/terraspace/logger.rb
terraspace-0.5.6 lib/terraspace/logger.rb
terraspace-0.5.5 lib/terraspace/logger.rb
terraspace-0.5.4 lib/terraspace/logger.rb
terraspace-0.5.3 lib/terraspace/logger.rb
terraspace-0.5.2 lib/terraspace/logger.rb
terraspace-0.5.1 lib/terraspace/logger.rb
terraspace-0.5.0 lib/terraspace/logger.rb