Debian Codegraph @

upstream/mageia-cauldron/man3pm/Test2::EventFacet::Trace.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "Test2::EventFacet::Trace 3pm"
61 .TH Test2::EventFacet::Trace 3pm 2025-06-24 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 Test2::EventFacet::Trace \- Debug information for events
68 .SH DESCRIPTION
69 .IX Header "DESCRIPTION"
70 The Test2::API::Context object, as well as all Test2::Event types need to
71 have access to information about where they were created. This object
72 represents that information.
73 .SH SYNOPSIS
74 .IX Header "SYNOPSIS"
75 .Vb 1
76 \& use Test2::EventFacet::Trace;
77 \&
78 \& my $trace = Test2::EventFacet::Trace\->new(
79 \& frame => [$package, $file, $line, $subname],
80 \& );
81 .Ve
82 .SH "FACET FIELDS"
83 .IX Header "FACET FIELDS"
84 .ie n .IP "$string = $trace\->{details}" 4
85 .el .IP "\f(CW$string\fR = \f(CW$trace\fR\->{details}" 4
86 .IX Item "$string = $trace->{details}"
87 .PD 0
88 .ie n .IP "$string = $trace\->\fBdetails()\fR" 4
89 .el .IP "\f(CW$string\fR = \f(CW$trace\fR\->\fBdetails()\fR" 4
90 .IX Item "$string = $trace->details()"
91 .PD
92 Used as a custom trace message that will be used INSTEAD of
93 \&\f(CW\*(C`at <FILE> line <LINE>\*(C'\fR when calling \f(CW\*(C`$trace\->debug\*(C'\fR.
94 .ie n .IP "$frame = $trace\->{frame}" 4
95 .el .IP "\f(CW$frame\fR = \f(CW$trace\fR\->{frame}" 4
96 .IX Item "$frame = $trace->{frame}"
97 .PD 0
98 .ie n .IP "$frame = $trace\->\fBframe()\fR" 4
99 .el .IP "\f(CW$frame\fR = \f(CW$trace\fR\->\fBframe()\fR" 4
100 .IX Item "$frame = $trace->frame()"
101 .PD
102 Get the call frame arrayref.
103 .Sp
104 .Vb 1
105 \& [$package, $file, $line, $subname]
106 .Ve
107 .ie n .IP "$int = $trace\->{pid}" 4
108 .el .IP "\f(CW$int\fR = \f(CW$trace\fR\->{pid}" 4
109 .IX Item "$int = $trace->{pid}"
110 .PD 0
111 .ie n .IP "$int = $trace\->\fBpid()\fR" 4
112 .el .IP "\f(CW$int\fR = \f(CW$trace\fR\->\fBpid()\fR" 4
113 .IX Item "$int = $trace->pid()"
114 .PD
115 The process ID in which the event was generated.
116 .ie n .IP "$int = $trace\->{tid}" 4
117 .el .IP "\f(CW$int\fR = \f(CW$trace\fR\->{tid}" 4
118 .IX Item "$int = $trace->{tid}"
119 .PD 0
120 .ie n .IP "$int = $trace\->\fBtid()\fR" 4
121 .el .IP "\f(CW$int\fR = \f(CW$trace\fR\->\fBtid()\fR" 4
122 .IX Item "$int = $trace->tid()"
123 .PD
124 The thread ID in which the event was generated.
125 .ie n .IP "$id = $trace\->{cid}" 4
126 .el .IP "\f(CW$id\fR = \f(CW$trace\fR\->{cid}" 4
127 .IX Item "$id = $trace->{cid}"
128 .PD 0
129 .ie n .IP "$id = $trace\->\fBcid()\fR" 4
130 .el .IP "\f(CW$id\fR = \f(CW$trace\fR\->\fBcid()\fR" 4
131 .IX Item "$id = $trace->cid()"
132 .PD
133 The ID of the context that was used to create the event.
134 .ie n .IP "$uuid = $trace\->{uuid}" 4
135 .el .IP "\f(CW$uuid\fR = \f(CW$trace\fR\->{uuid}" 4
136 .IX Item "$uuid = $trace->{uuid}"
137 .PD 0
138 .ie n .IP "$uuid = $trace\->\fBuuid()\fR" 4
139 .el .IP "\f(CW$uuid\fR = \f(CW$trace\fR\->\fBuuid()\fR" 4
140 .IX Item "$uuid = $trace->uuid()"
141 .PD
142 The UUID of the context that was used to create the event. (If uuid tagging was
143 enabled)
144 .ie n .IP "($pkg, $file, $line, $subname) = $trace\->call" 4
145 .el .IP "($pkg, \f(CW$file\fR, \f(CW$line\fR, \f(CW$subname\fR) = \f(CW$trace\fR\->call" 4
146 .IX Item "($pkg, $file, $line, $subname) = $trace->call"
147 Get the basic call info as a list.
148 .ie n .IP "@caller = $trace\->full_call" 4
149 .el .IP "\f(CW@caller\fR = \f(CW$trace\fR\->full_call" 4
150 .IX Item "@caller = $trace->full_call"
151 Get the full caller(N) results.
152 .ie n .IP "$warning_bits = $trace\->warning_bits" 4
153 .el .IP "\f(CW$warning_bits\fR = \f(CW$trace\fR\->warning_bits" 4
154 .IX Item "$warning_bits = $trace->warning_bits"
155 Get index 9 from the full caller info. This is the warnings_bits field.
156 .Sp
157 The value of this is not portable across perl versions or even processes.
158 However it can be used in the process that generated it to reproduce the
159 warnings settings in a new scope.
160 .Sp
161 .Vb 4
162 \& eval <<EOT;
163 \& BEGIN { ${^WARNING_BITS} = $trace\->warning_bits };
164 \& ... context\*(Aqs warning settings apply here ...
165 \& EOT
166 .Ve
167 .SS "DISCOURAGED HUB RELATED FIELDS"
168 .IX Subsection "DISCOURAGED HUB RELATED FIELDS"
169 These fields were not always set properly by tools. These are \fBMOSTLY\fR
170 deprecated by the Test2::EventFacet::Hub facets. These fields are not
171 required, and may only reflect the hub that was current when the event was
172 created, which is not necessarily the same as the hub the event was sent
173 through.
174 .PP
175 Some tools did do a good job setting these to the correct hub, but you cannot
176 always rely on that. Use the \*(Aqhubs\*(Aq facet list instead.
177 .ie n .IP "$hid = $trace\->{hid}" 4
178 .el .IP "\f(CW$hid\fR = \f(CW$trace\fR\->{hid}" 4
179 .IX Item "$hid = $trace->{hid}"
180 .PD 0
181 .ie n .IP "$hid = $trace\->\fBhid()\fR" 4
182 .el .IP "\f(CW$hid\fR = \f(CW$trace\fR\->\fBhid()\fR" 4
183 .IX Item "$hid = $trace->hid()"
184 .PD
185 The ID of the hub that was current when the event was created.
186 .ie n .IP "$huuid = $trace\->{huuid}" 4
187 .el .IP "\f(CW$huuid\fR = \f(CW$trace\fR\->{huuid}" 4
188 .IX Item "$huuid = $trace->{huuid}"
189 .PD 0
190 .ie n .IP "$huuid = $trace\->\fBhuuid()\fR" 4
191 .el .IP "\f(CW$huuid\fR = \f(CW$trace\fR\->\fBhuuid()\fR" 4
192 .IX Item "$huuid = $trace->huuid()"
193 .PD
194 The UUID of the hub that was current when the event was created. (If uuid
195 tagging was enabled).
196 .ie n .IP "$int = $trace\->{nested}" 4
197 .el .IP "\f(CW$int\fR = \f(CW$trace\fR\->{nested}" 4
198 .IX Item "$int = $trace->{nested}"
199 .PD 0
200 .ie n .IP "$int = $trace\->\fBnested()\fR" 4
201 .el .IP "\f(CW$int\fR = \f(CW$trace\fR\->\fBnested()\fR" 4
202 .IX Item "$int = $trace->nested()"
203 .PD
204 How deeply nested the event is.
205 .ie n .IP "$bool = $trace\->{buffered}" 4
206 .el .IP "\f(CW$bool\fR = \f(CW$trace\fR\->{buffered}" 4
207 .IX Item "$bool = $trace->{buffered}"
208 .PD 0
209 .ie n .IP "$bool = $trace\->\fBbuffered()\fR" 4
210 .el .IP "\f(CW$bool\fR = \f(CW$trace\fR\->\fBbuffered()\fR" 4
211 .IX Item "$bool = $trace->buffered()"
212 .PD
213 True if the event was buffered and not sent to the formatter independent of a
214 parent (This should never be set when nested is \f(CW0\fR or \f(CW\*(C`undef\*(C'\fR).
215 .SH METHODS
216 .IX Header "METHODS"
217 \&\fBNote:\fR All facet frames are also methods.
218 .ie n .IP $trace\->set_detail($msg) 4
219 .el .IP \f(CW$trace\fR\->set_detail($msg) 4
220 .IX Item "$trace->set_detail($msg)"
221 .PD 0
222 .ie n .IP "$msg = $trace\->detail" 4
223 .el .IP "\f(CW$msg\fR = \f(CW$trace\fR\->detail" 4
224 .IX Item "$msg = $trace->detail"
225 .PD
226 Used to get/set a custom trace message that will be used INSTEAD of
227 \&\f(CW\*(C`at <FILE> line <LINE>\*(C'\fR when calling \f(CW\*(C`$trace\->debug\*(C'\fR.
228 .Sp
229 \&\f(CWdetail()\fR is an alias to the \f(CW\*(C`details\*(C'\fR facet field for backwards
230 compatibility.
231 .ie n .IP "$str = $trace\->debug" 4
232 .el .IP "\f(CW$str\fR = \f(CW$trace\fR\->debug" 4
233 .IX Item "$str = $trace->debug"
234 Typically returns the string \f(CW\*(C`at <FILE> line <LINE>\*(C'\fR. If \f(CW\*(C`detail\*(C'\fR is set
235 then its value will be returned instead.
236 .ie n .IP $trace\->alert($MESSAGE) 4
237 .el .IP \f(CW$trace\fR\->alert($MESSAGE) 4
238 .IX Item "$trace->alert($MESSAGE)"
239 This issues a warning at the frame (filename and line number where
240 errors should be reported).
241 .ie n .IP $trace\->throw($MESSAGE) 4
242 .el .IP \f(CW$trace\fR\->throw($MESSAGE) 4
243 .IX Item "$trace->throw($MESSAGE)"
244 This throws an exception at the frame (filename and line number where
245 errors should be reported).
246 .ie n .IP "($package, $file, $line, $subname) = $trace\->\fBcall()\fR" 4
247 .el .IP "($package, \f(CW$file\fR, \f(CW$line\fR, \f(CW$subname\fR) = \f(CW$trace\fR\->\fBcall()\fR" 4
248 .IX Item "($package, $file, $line, $subname) = $trace->call()"
249 Get the caller details for the debug\-info. This is where errors should be
250 reported.
251 .ie n .IP "$pkg = $trace\->package" 4
252 .el .IP "\f(CW$pkg\fR = \f(CW$trace\fR\->package" 4
253 .IX Item "$pkg = $trace->package"
254 Get the debug\-info package.
255 .ie n .IP "$file = $trace\->file" 4
256 .el .IP "\f(CW$file\fR = \f(CW$trace\fR\->file" 4
257 .IX Item "$file = $trace->file"
258 Get the debug\-info filename.
259 .ie n .IP "$line = $trace\->line" 4
260 .el .IP "\f(CW$line\fR = \f(CW$trace\fR\->line" 4
261 .IX Item "$line = $trace->line"
262 Get the debug\-info line number.
263 .ie n .IP "$subname = $trace\->subname" 4
264 .el .IP "\f(CW$subname\fR = \f(CW$trace\fR\->subname" 4
265 .IX Item "$subname = $trace->subname"
266 Get the debug\-info subroutine name.
267 .ie n .IP "$sig = trace\->signature" 4
268 .el .IP "\f(CW$sig\fR = trace\->signature" 4
269 .IX Item "$sig = trace->signature"
270 Get a signature string that identifies this trace. This is used to check if
271 multiple events are related. The signature includes pid, tid, file, line
272 number, and the cid.
273 .SH SOURCE
274 .IX Header "SOURCE"
275 The source code repository for Test2 can be found at
276 <https://github.com/Test\-More/test\-more/>.
277 .SH MAINTAINERS
278 .IX Header "MAINTAINERS"
279 .IP "Chad Granum <[email protected]>" 4
280 .IX Item "Chad Granum <[email protected]>"
281 .SH AUTHORS
282 .IX Header "AUTHORS"
283 .IP "Chad Granum <[email protected]>" 4
284 .IX Item "Chad Granum <[email protected]>"
285 .SH COPYRIGHT
286 .IX Header "COPYRIGHT"
287 Copyright Chad Granum <[email protected]>.
288 .PP
289 This program is free software; you can redistribute it and/or
290 modify it under the same terms as Perl itself.
291 .PP
292 See <https://dev.perl.org/licenses/>