LogStream: Added a testing mode to the simgear logstreams.
The new function logstream::setTestingMode() has been created to allow for a testing mode to be set. This stores a boolean in the private logstream thread which modifies the behaviour of the would_log() function, allowing for everything to be logged. The removeCallbacks() function has also been added, allowing for the default fgfs output to STDOUT and STDERR to be silenced when calling setTestingMode().
This commit is contained in:
committed by
James Turner
parent
62ae6ca35e
commit
340a469153
@@ -158,12 +158,22 @@ public:
|
||||
|
||||
void removeCallback(simgear::LogCallback* cb);
|
||||
|
||||
void removeCallbacks();
|
||||
|
||||
/**
|
||||
* optionally record all entries and submit them to new log callbacks that
|
||||
* are added. This allows simplified logging configuration, but still including
|
||||
* early startup information in all logs.
|
||||
*/
|
||||
void setStartupLoggingEnabled(bool enabled);
|
||||
|
||||
/**
|
||||
* Set up the logstream for running in test mode. For example the callbacks
|
||||
* will be unregistered and the behaviour of the would_log() function
|
||||
* sanitized.
|
||||
*/
|
||||
void setTestingMode(bool testMode);
|
||||
|
||||
private:
|
||||
// constructor
|
||||
logstream();
|
||||
|
||||
Reference in New Issue
Block a user