[#BloombergLP-ball-AsyncFileObserver-2constructor-0b]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/AsyncFileObserver.adoc[AsyncFileObserver]::AsyncFileObserver
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

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

Create an async file observer that asynchronously publishes log records to `stdout` if their severity is at least as severe as the optionally specified `stdoutThreshold` level, and has file logging initially disabled&period; If `stdoutThreshold` is not specified, log records are published to `stdout` if their severity is at least as severe as `Severity&colon;&colon;e&lowbar;WARN`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; Records received by the `publish` method are appended to a queue having a maximum (fixed) length of 8192, and published later by an independent publication thread&period; All records received while the queue is full are discarded&period; (See &lcub;Log Record Queue&rcub; for further information&period;) Note that `isPublishInLocalTimeEnabled` returns `false` following construction indicating that the timestamp attribute of published records will be written in UTC time (see `enablePublishInLocalTime`)&period; Also note that independent default record formats are in effect for `stdout` and file logging (see `setLogFormat`)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/ball/AsyncFileObserver/2constructor-0e.adoc[AsyncFileObserver](xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/ball/AsyncFileObserver/2constructor-0e.adoc[_» more&period;&period;&period;_]#

Create an async file observer with the specified `stdoutThreshold`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/ball/AsyncFileObserver/2constructor-0d.adoc[AsyncFileObserver](
    xref:BloombergLP/ball/Severity/Level.adoc[Severity::Level] stdoutThreshold,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/ball/AsyncFileObserver/2constructor-0d.adoc[_» more&period;&period;&period;_]#

Create an async file observer that asynchronously publishes log records to `stdout` if their severity is at least as severe as the specified `stdoutThreshold` level, and has file logging initially disabled&period; The timestamp attribute of published records is written in local time if the specified `publishInLocalTime` flag is `true`, and in UTC time otherwise&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; Records received by the `publish` method are appended to a queue having a maximum (fixed) length of 8192, and published later by an independent publication thread&period; All records received while the queue is full are discarded&period; (See &lcub;Log Record Queue&rcub; for further information&period;) Note that independent default record formats are in effect for `stdout` and file logging (see `setLogFormat`)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/ball/AsyncFileObserver/2constructor-0c.adoc[AsyncFileObserver](
    xref:BloombergLP/ball/Severity/Level.adoc[Severity::Level] stdoutThreshold,
    bool publishInLocalTime,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/ball/AsyncFileObserver/2constructor-0c.adoc[_» more&period;&period;&period;_]#

Create an async file observer that asynchronously publishes log records to `stdout` if their severity is at least as severe as the specified `stdoutThreshold` level, and has file logging initially disabled&period; The timestamp attribute of published records is written in local time if the specified `publishInLocalTime` flag is `true`, and in UTC time otherwise&period; Records received by the `publish` method are appended to a queue having the specified (fixed) `maxRecordQueueSize`, and published later by an independent publication thread&period; Optionally specify a `dropRecordsOnFullQueueThreshold` indicating the severity threshold below which records received when the queue is full will be discarded&semi; records received whose severity is at least as severe as this threshold will block the calling thread if the queue is full, until space is available&period; If `dropRecordsOnFullQueueThreshold` is not specified, all records received while the queue is full are discarded&period; (See &lcub;Log Record Queue&rcub; for further information&period;) Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; Note that independent default record formats are in effect for `stdout` and file logging (see `setLogFormat`)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/ball/AsyncFileObserver/2constructor-05.adoc[AsyncFileObserver](
    xref:BloombergLP/ball/Severity/Level.adoc[Severity::Level] stdoutThreshold,
    bool publishInLocalTime,
    int maxRecordQueueSize,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/ball/AsyncFileObserver/2constructor-05.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, additionally taking the specified `dropRecordsOnFullQueueThreshold`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/ball/AsyncFileObserver/2constructor-00.adoc[AsyncFileObserver](
    xref:BloombergLP/ball/Severity/Level.adoc[Severity::Level] stdoutThreshold,
    bool publishInLocalTime,
    int maxRecordQueueSize,
    xref:BloombergLP/ball/Severity/Level.adoc[Severity::Level] dropRecordsOnFullQueueThreshold,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/ball/AsyncFileObserver/2constructor-00.adoc[_» more&period;&period;&period;_]#


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