Create an async file observer that logs to stdout by default.

Synopsis

Declared in <ball_asyncfileobserver.h>

explicit
AsyncFileObserver(bslma::Allocator* basicAllocator = 0);

Description

Create an async file observer that asynchronously publishes log records to stdout if their severity is at least as severe as Severity::e_WARN, and has file logging initially disabled. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. 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. All records received while the queue is full are discarded. (See {Log Record Queue} for further information.) Note that isPublishInLocalTimeEnabled returns false following construction indicating that the timestamp attribute of published records will be written in UTC time (see enablePublishInLocalTime). Also note that independent default record formats are in effect for stdout and file logging (see setLogFormat).

Parameters

Name

Description

basicAllocator

memory allocator; null uses the default

Created with MrDocs