diff --git a/2022/1/16/json_load_and_parse.rb b/2022/1/16/json_load_and_parse.rb new file mode 100644 index 0000000..17ec574 --- /dev/null +++ b/2022/1/16/json_load_and_parse.rb @@ -0,0 +1,6 @@ +require 'json' +require 'trace_location' + +TraceLocation.trace(format: :log) do + JSON.load('{"foo": 42}') +end diff --git a/2022/1/16/trace_location-2022011601011642265241.log b/2022/1/16/trace_location-2022011601011642265241.log new file mode 100644 index 0000000..257019c --- /dev/null +++ b/2022/1/16/trace_location-2022011601011642265241.log @@ -0,0 +1,13 @@ +Logged by TraceLocation gem at 2022-01-16 01:47:21 +0900 +https://github.com/yhirano55/trace_location + +[Tracing events] C: Call, R: Return + +C /home/pocke/.rbenv/versions/trunk/lib/ruby/3.2.0/json/common.rb:557 [JSON.load] + C /home/pocke/.rbenv/versions/trunk/lib/ruby/3.2.0/json/common.rb:215 [JSON.parse] + C /home/pocke/.rbenv/versions/trunk/lib/ruby/3.2.0/json/common.rb:126 [JSON.create_id] + R /home/pocke/.rbenv/versions/trunk/lib/ruby/3.2.0/json/common.rb:128 [JSON.create_id] + R /home/pocke/.rbenv/versions/trunk/lib/ruby/3.2.0/json/common.rb:217 [JSON.parse] +R /home/pocke/.rbenv/versions/trunk/lib/ruby/3.2.0/json/common.rb:572 [JSON.load] + +Result: {"foo"=>42}