Observer that publishes log records to a user‐specified file.
Synopsis
Declared in <ball_fileobserver2.h>
class FileObserver2
: public Observer
Description
This class implements the Observer protocol. The publish method of this class outputs the log records that it receives 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 |
|
|
Callback invoked after each attempt to rotate the log file. |
|
|
Member Functions
Name |
Description |
|
Create a file observer with file logging initially disabled. |
|
Close the log file of this file observer if file logging is enabled, and destroy this file observer. |
Disable file logging for this file observer. |
|
Disable log file rotation based on a periodic time interval for this file observer. This method has no effect if rotation‐on‐time‐interval is not enabled. |
|
Disable publishing of record timestamps in local time. |
|
Disable log file rotation based on log file size for this file observer. This method has no effect if rotation‐on‐size is not enabled. |
|
Disable log file rotation based on a periodic time interval for this file observer. This method has no effect if rotation‐on‐time‐interval is not enabled. |
|
|
|
Enable publishing of record timestamps in local time. |
|
Force an immediate log file rotation by this observer. |
|
Return the format config of the last successful |
|
|
|
Return |
|
Return |
|
Return the local‐minus‐UTC offset captured at construction. |
|
Publish the specified log |
|
|
Discard shared references to published |
Configure periodic log file rotation at the specified |
|
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 file observer if rotation‐on‐size is in effect, and 0 otherwise. |
|
Set the log‐file record format from the specified |
|
Set the formatting functor used when writing records to the log file. |
|
Set the callback invoked after each log file rotation attempt. |
|
Suppress or enable unique filenames when rotating the log file. |
|
|
Declare that this type uses a |
Created with MrDocs