Asynchronous observer that publishes log records to stdout and a file.
Synopsis
Declared in <ball_asyncfileobserver.h>
class AsyncFileObserver
: public Observer
Description
This class implements the Observer protocol. The publish method of this class outputs log records asynchronously to stdout and optionally to a user‐specified file. This class is thread‐safe; different threads can operate on an object concurrently. This class is exception‐neutral with no guarantee of rollback. In no event is memory leaked.
Base Classes
Name |
Description |
This class provides a protocol for receiving and processing log record output. |
Type Aliases
Name |
Description |
Alias for a user‐supplied callback invoked after log file rotation. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this observer after draining and stopping publication. |
Disable file logging for this async file observer. |
|
Disable publishing of record timestamps in local time. |
|
Disable log file rotation based on log file size for this async file observer. This method has no effect if rotation‐on‐size is not enabled. |
|
Disable the long output format when logging to |
|
Disable log file rotation based on a periodic time interval for this async file observer. This method has no effect if rotation‐on‐time‐interval is not enabled. |
|
Enable file logging using a name derived from |
|
Enable publishing of record timestamps in local time. |
|
Enable the long output format when logging to |
|
Force an immediate log file rotation by this observer. |
|
Return the format specification used for log‐file records. |
|
Load the log‐file and |
|
Return the format specification used for |
|
|
|
Return |
|
Return |
|
Return |
|
Return |
|
|
Return |
Return the local‐minus‐UTC offset captured at construction. |
|
|
|
Return the number of log records currently on the record queue of this async file observer. |
|
|
Discard shared references to |
Rotate the log file when its size exceeds the specified |
|
|
|
Return the log file lifetime that triggers rotation, or zero. |
|
Return the size (in kilobytes) of the log file that will trigger a file rotation by this async file observer if rotation‐on‐size is in effect, and 0 otherwise. |
|
Set the format specification for log records written to the log file. |
|
Same as |
|
Set the format specifications for log‐file and |
|
Set the callback invoked after each log file rotation attempt. |
|
Set the format specification for log records written to |
|
Set the minimum severity of records logged to |
|
Stop the publication thread without draining the record queue. |
|
Start a thread that asynchronously publishes queued log records. |
|
Return the minimum severity of records logged to |
|
Drain the record queue, then stop the publication thread. |
|
Suppress or enable unique filenames when rotating the log file. |
|
|
Declare that this type uses a |