[#BloombergLP-ball-TestObserver-2constructor-04]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/TestObserver.adoc[TestObserver]::TestObserver
:relfileprefix: ../../../
:mrdocs:

Create a test observer writing to the specified `stream`&period;

== Synopsis

Declared in `&lt;ball&lowbar;testobserver&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
TestObserver(
    std::ostream* stream,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

== Description

Create a test observer having a unique integer identifier, whose `publish` method will print diagnostic information (if any) to the specified `stream`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; By default, this observer prints nothing to `stream`&period; Note that the `setVerbose` method can affect this default behavior&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *stream*
| destination for diagnostic output from `publish`
| *basicAllocator*
| memory allocator&semi; null uses the default
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
