mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 12:12:15 +02:00
unit testing: LogOutputCollector: added log_wrapper() method for multi-threaded tests
To enable logging in new threads, add this line to the beginning of your thread function: Log::Context log_context(testLog->log_wrapper()); Signed-off-by: James Yonan <james@openvpn.net>
This commit is contained in:
parent
0657de823e
commit
f50bcab9e4
@ -109,12 +109,18 @@ namespace openvpn {
|
||||
return getOutput();
|
||||
}
|
||||
|
||||
const Log::Context::Wrapper& log_wrapper()
|
||||
{
|
||||
return log_wrap;
|
||||
}
|
||||
|
||||
private:
|
||||
bool output_log = true;
|
||||
bool collect_log = false;
|
||||
std::stringstream out;
|
||||
std::mutex mutex{};
|
||||
Log::Context log_context;
|
||||
Log::Context::Wrapper log_wrap; // must be constructed after log_context
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user