1 package Test2::EventFacet::Info;
5 our $VERSION = '1.302175';
9 BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
10 use Test2::Util::HashBase qw{-tag -debug -important -table};
22 Test2::EventFacet::Info - Facet for information a developer might care about.
26 This facet represents messages intended for humans that will help them either
27 understand a result, or diagnose a failure.
31 This facet appears in a list instead of being a single item.
37 =item $string_or_structure = $info->{details}
39 =item $string_or_structure = $info->details()
41 Human readable string or data structure, this is the information to display.
42 Formatters are free to render the structures however they please. This may
43 contain a blessed object.
45 If the C<table> attribute (see below) is set then a renderer may choose to
46 display the table instead of the details.
48 =item $structure = $info->{table}
50 =item $structure = $info->table()
52 If the data the C<info> facet needs to convey can be represented as a table
53 then the data may be placed in this attribute in a more raw form for better
54 display. The data must also be represented in the C<details> attribute for
55 renderers which do not support rendering tables directly.
60 header => [ 'column 1 header', 'column 2 header', ... ], # Optional
63 ['row 1 column 1', 'row 1, column 2', ... ],
64 ['row 2 column 1', 'row 2, column 2', ... ],
68 # Allow the renderer to hide empty columns when true, Optional
71 # List by name or number columns that should never be collapsed
72 no_collapse => \@LIST,
75 =item $short_string = $info->{tag}
77 =item $short_string = $info->tag()
79 Short tag to categorize the info. This is usually 10 characters or less,
80 formatters may truncate longer tags.
82 =item $bool = $info->{debug}
84 =item $bool = $info->debug()
86 Set this to true if the message is critical, or explains a failure. This is
87 info that should be displayed by formatters even in less-verbose modes.
89 When false the information is not considered critical and may not be rendered
90 in less-verbose modes.
92 =item $bool = $info->{important}
94 =item $bool = $info->important
96 This should be set for non debug messages that are still important enough to
97 show when a formatter is in quiet mode. A formatter should send these to STDOUT
98 not STDERR, but should show them even in non-verbose mode.
104 The source code repository for Test2 can be found at
105 F<http://github.com/Test-More/test-more/>.
111 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
119 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
125 Copyright 2019 Chad Granum E<lt>exodist@cpan.orgE<gt>.
127 This program is free software; you can redistribute it and/or
128 modify it under the same terms as Perl itself.
130 See F<http://dev.perl.org/licenses/>