Sha256: de8787a43d8a84a53644cef23c70238f9cac8741390d327f3e877a5b263eada6

Contents?: true

Size: 726 Bytes

Versions: 14

Compression:

Stored size: 726 Bytes

Contents

module Stackify
  class MsgObject
    def initialize level, msg, caller_str, trans_id=nil, log_uuid=nil, ex=nil
      @level, @msg, @caller_str, @ex = level, msg, caller_str, ex, @trans_id = trans_id,
      @log_uuid = log_uuid
    end

    def to_h
      {
        'id' => @log_uuid,
        'Msg' => @msg.to_s,
        'data' => nil,
        'Ex' => @ex.try(:to_h),
        'Level' => @level.to_s.upcase!,
        #'Tags' => %w(ruby rails),
        'EpochMs' => Time.now.to_f * 1000,
        'Th' => Thread.current.object_id.to_s,
        'TransID' => @trans_id,
        'SrcMethod' => Stackify::Backtrace.method_name(@caller_str),
        'SrcLine' => Stackify::Backtrace.line_number(@caller_str)
      }
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
stackify-api-ruby-2.1.0 lib/stackify/utils/msg_object.rb
stackify-api-ruby-2.1.0.beta1 lib/stackify/utils/msg_object.rb
stackify-api-ruby-2.0.0 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.3.0.beta1 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.2.10 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.2.9 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.2.7 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.2.4 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.2.3 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.1.0 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.0.15 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.0.14 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.0.13 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.0.12 lib/stackify/utils/msg_object.rb