
TB2::Formatter - Base class for formatting test results

package TB2::Formatter::SomeFormat; use TB2::Mouse; extends "TB2::Formatter;

Test::Builder2 delegates the actual formating of test results to a TB2::Formatter object. This can then decide if it's going to formatter TAP or XML or send email or whatever.
A Formatter is just a special TB2::EventHandler which can produce output.

You must implement handle methods as any EventHandler.
In addition...
Contains the class to use to make a Streamer.
Defaults to $formatter->default_streamer_class
Contains the Streamer object to write to. One will be created for you using $formatter->streamer_class.
By default, the subtest handler inherits its parent's streamer.
my $formatter = TB2::Formatter->new(%args);
Creates a new formatter object to feed results to.
You want to call this on a subclass.
$formatter->write($destination, @text);
Outputs @text to the named $destination.
@text is treated like print, so it is simply concatenated.
In reality, this is a hand off to $formatter->streamer->write.
$formatter->reset_streamer;
Changes $formatter->streamer back to the default.
my $id = $thing->object_id;
Returns an identifier for this object unique to the running process. The identifier is fairly simple and easily predictable.
See TB2::HasObjectID