Skip to content

Commit dc9a469

Browse files
committed
Adding Id key to MsgObject for transaction_id value
Signed-off-by: Jedi Ballono <jballono@stackify.com>
1 parent e68523e commit dc9a469

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/stackify/utils/msg_object.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module Stackify
22
class MsgObject
3-
def initialize level, msg, caller_str, ex=nil
4-
@level, @msg, @caller_str, @ex = level, msg, caller_str, ex
3+
def initialize level, msg, caller_str, id=nil, ex=nil
4+
@level, @msg, @caller_str, @ex = level, msg, caller_str, ex, @id = id
55
end
66

77
def to_h
8-
{
8+
details = {
99
'Msg' => @msg.to_s,
1010
'data' => nil,
1111
'Ex' => @ex.try(:to_h),
@@ -17,6 +17,8 @@ def to_h
1717
'SrcMethod' => Stackify::Backtrace.method_name(@caller_str),
1818
'SrcLine' => Stackify::Backtrace.line_number(@caller_str)
1919
}
20+
details['Id'] = @id if @id
21+
return details
2022
end
2123
end
2224
end

0 commit comments

Comments
 (0)