From d0def19069b855d0bc8401877cfee89190cd9ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Fri, 21 Dec 2018 11:28:45 +0100 Subject: [PATCH] Add --verbose flag to test_main Bug: None Change-Id: Iec85fc59a13bde92e866e468ac451822e4fb82e1 Reviewed-on: https://webrtc-review.googlesource.com/c/115409 Reviewed-by: Sebastian Jansson Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#26083} --- test/test_main_lib.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/test_main_lib.cc b/test/test_main_lib.cc index 996c11d87e..ef595c7d9c 100644 --- a/test/test_main_lib.cc +++ b/test/test_main_lib.cc @@ -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(); #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