Add --verbose flag to test_main

Bug: None
Change-Id: Iec85fc59a13bde92e866e468ac451822e4fb82e1
Reviewed-on: https://webrtc-review.googlesource.com/c/115409
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26083}
This commit is contained in:
Niels Möller
2018-12-21 11:28:45 +01:00
committed by Commit Bot
parent c0a67baa36
commit d0def19069

View File

@ -65,6 +65,7 @@ WEBRTC_DEFINE_string(
#endif
WEBRTC_DEFINE_bool(logs, false, "print logs to stderr");
WEBRTC_DEFINE_bool(verbose, false, "verbose logs to stderr");
WEBRTC_DEFINE_string(
force_fieldtrials,
@ -86,7 +87,6 @@ class TestMainImpl : public TestMain {
// Default to LS_INFO, even for release builds to provide better test
// logging.
// TODO(pbos): Consider adding a command-line override.
if (rtc::LogMessage::GetLogToDebug() > rtc::LS_INFO)
rtc::LogMessage::LogToDebug(rtc::LS_INFO);
@ -98,6 +98,11 @@ class TestMainImpl : public TestMain {
return 0;
}
if (FLAG_verbose)
rtc::LogMessage::LogToDebug(rtc::LS_VERBOSE);
rtc::LogMessage::SetLogToStderr(FLAG_logs || FLAG_verbose);
// TODO(bugs.webrtc.org/9792): we need to reference something from
// fileutils.h so that our downstream hack where we replace fileutils.cc
// works. Otherwise the downstream flag implementation will take over and
@ -115,8 +120,6 @@ class TestMainImpl : public TestMain {
winsock_init_ = absl::make_unique<rtc::WinsockInitializer>();
#endif
rtc::LogMessage::SetLogToStderr(FLAG_logs);
// Ensure that main thread gets wrapped as an rtc::Thread.
// TODO(bugs.webrt.org/9714): It might be better to avoid wrapping the main
// thread, or leave it to individual tests that need it. But as long as we