Sha256: 88c1cb0e7014115903653b2c53d4c0ad1d86480dee4526f36491acdd6b1c454b

Contents?: true

Size: 311 Bytes

Versions: 3

Compression:

Stored size: 311 Bytes

Contents

# Formatter for log messages
class CustomFormatter < Logger::Formatter
  def call(severity, time, progname, msg)
    "[#{time}] #{five_chars(severity)} - #{progname}: #{msg2str(msg)}\n"
  end

  def five_chars(string)
    result = ''
    (5 - string.length).times { result << ' ' }
    result + string
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mangopay-v4-4.1.0 lib/mangopay/util/custom_formatter.rb
mangopay-v4-4.0.2 lib/mangopay/util/custom_formatter.rb
mangopay-v4-4.0.1 lib/mangopay/util/custom_formatter.rb