Sha256: 8628c723d245a821681225d280ff34a0e5ef2aac60e898dcaf9964a99cf91f2b

Contents?: true

Size: 677 Bytes

Versions: 4

Compression:

Stored size: 677 Bytes

Contents

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

    def to_h
      {
        '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' => Stackify::EnvDetails.instance.request_details.try{ |d| d['uuid'] },
        'SrcMethod' => Stackify::Backtrace.method_name(@caller_str),
        'SrcLine' => Stackify::Backtrace.line_number(@caller_str)
      }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
stackify-api-ruby-1.0.3 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.0.2 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.0.1 lib/stackify/utils/msg_object.rb
stackify-api-ruby-1.0.0 lib/stackify/utils/msg_object.rb