Sha256: b9ba6b3dec8abdf4db78e8d440efc5429adfd0d95a3065059dc034b7ce1a4c90

Contents?: true

Size: 1.09 KB

Versions: 8

Compression:

Stored size: 1.09 KB

Contents

require 'logatron/contexts'
require 'logatron/configuration'
module Logatron
  module Formatting
    def milliseconds_elapsed(finish, start)
      (finish - start) * 1000.0
    end

    def format_log(msg: '-', status: '-', duration: '-', request: '-', inputs: '-', severity: '-')
      Logatron.configuration.transformer.call({
                                                  timestamp: Time.now.iso8601,
                                                  severity: severity,
                                                  host: Logatron.configuration.host,
                                                  id: Contexts.msg_id,
                                                  site: Contexts.site,
                                                  status: status,
                                                  duration: duration,
                                                  request: request,
                                                  source: inputs,
                                                  body: msg
                                              }) + "\n"
    end
  end
end



Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
logatron-0.2.5 lib/logatron/message_formatting.rb
logatron-0.2.4 lib/logatron/message_formatting.rb
logatron-0.2.3 lib/logatron/message_formatting.rb
logatron-0.2.2 lib/logatron/message_formatting.rb
logatron-0.2.1 lib/logatron/message_formatting.rb
logatron-0.2.0 lib/logatron/message_formatting.rb
logatron-0.1.11 lib/logatron/message_formatting.rb
logatron-0.1.4 lib/logatron/message_formatting.rb