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