Sha256: e872bb3e7afe1902463f1fde469318eb7004702b24d98f01213fa5247d53e459

Contents?: true

Size: 465 Bytes

Versions: 25

Compression:

Stored size: 465 Bytes

Contents

class PostageApp::Logger < ::Logger
  
  def format_message(severity, datetime, progname, msg)
    timestamp = datetime.strftime('%m/%d/%Y %H:%M:%S %Z')
    message = case msg
      when PostageApp::Request
        "REQUEST [#{msg.url}]\n #{msg.arguments_to_send.to_json}"
      when PostageApp::Response
        "RESPONSE [#{msg.status} #{msg.uid} #{msg.message}]\n #{msg.data.to_json}"
      else
        msg
    end
    "[#{timestamp}] #{message}\n"
  end
  
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
postageapp-1.0.24 lib/postageapp/logger.rb
postageapp-1.0.23 lib/postageapp/logger.rb
postageapp-1.0.22 lib/postageapp/logger.rb
postageapp-1.0.21 lib/postageapp/logger.rb
postageapp-1.0.20 lib/postageapp/logger.rb
postageapp-1.0.19 lib/postageapp/logger.rb
postageapp-1.0.18 lib/postageapp/logger.rb
postageapp-1.0.17 lib/postageapp/logger.rb
postageapp-1.0.16 lib/postageapp/logger.rb
postageapp-1.0.15 lib/postageapp/logger.rb
postageapp-1.0.14 lib/postageapp/logger.rb
postageapp-1.0.13 lib/postageapp/logger.rb
postageapp-1.0.12 lib/postageapp/logger.rb
postageapp-1.0.11 lib/postageapp/logger.rb
postageapp-1.0.10 lib/postageapp/logger.rb
postageapp-1.0.9 lib/postageapp/logger.rb
postageapp-1.0.8 lib/postageapp/logger.rb
postageapp-1.0.7 lib/postageapp/logger.rb
postageapp-1.0.6 lib/postageapp/logger.rb
postageapp-1.0.5 lib/postageapp/logger.rb