18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/private_please/tracking/debug/trace_point_data_logger.rb', line 18
def self.format(cur_tpd)
class_and_method = cur_tpd.method_full_name
if @prev_cur_tpd.nil?
same_object_id = same_lineno = false
else
same_object_id = @prev_cur_tpd.object_id == cur_tpd.object_id
same_lineno = @prev_cur_tpd.lineno == cur_tpd.lineno
same_code = @prev_cur_tpd.code == cur_tpd.code
same_class_and_method = @prev_class_and_method == class_and_method
same_self = @prev_self == cur_tpd._self
same_defined_class = @prev_defined_class == cur_tpd.defined_class
end
@prev_cur_tpd = cur_tpd
@prev_class_and_method = class_and_method
@prev_self = cur_tpd._self
@prev_defined_class = cur_tpd.defined_class
data = {
marker: MARKERS[cur_tpd.event],
lineno: same_lineno ? '==' : cur_tpd.lineno,
event: cur_tpd.event,
object_id: same_object_id ? '==' : cur_tpd.object_id,
code: same_code ? '"' : cur_tpd.code,
class_and_method: same_class_and_method ? '""' : class_and_method,
_self: same_self ? '=' : cur_tpd._self,
defined_class: same_defined_class ? '=' : cur_tpd.defined_class
}
text_line(data)
end
|