From b70da0ed9314fedc72412530f485eaf134e0844f Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Mon, 7 Oct 2019 22:56:42 -0700 Subject: [PATCH] Add --quiet to suppress LOG(INFO) outputs Closes #661. Change-Id: Ic75479fba4f8dc26146b42b85ab95af6151302b6 --- docs/source/documentation.rst | 1 + packager/app/packager_main.cc | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/source/documentation.rst b/docs/source/documentation.rst index f007805151..a0d06b8ffa 100644 --- a/docs/source/documentation.rst +++ b/docs/source/documentation.rst @@ -36,6 +36,7 @@ Synopsis $ packager ... \ [--dump_stream_info] \ + [--quiet] \ [Chunking Options] \ [MP4 Output Options] \ [encryption / decryption options] \ diff --git a/packager/app/packager_main.cc b/packager/app/packager_main.cc index 27c734b8fa..a55557cb57 100644 --- a/packager/app/packager_main.cc +++ b/packager/app/packager_main.cc @@ -39,6 +39,7 @@ DEFINE_bool(dump_stream_info, false, "Dump demuxed stream info."); DEFINE_bool(licenses, false, "Dump licenses."); +DEFINE_bool(quiet, false, "When enabled, LOG(INFO) output is suppressed."); DEFINE_bool(use_fake_clock_for_muxer, false, "Set to true to use a fake clock for muxer. With this flag set, " @@ -500,6 +501,8 @@ int PackagerMain(int argc, char** argv) { google::ShowUsageWithFlags("Usage"); return kSuccess; } + if (FLAGS_quiet) + logging::SetMinLogLevel(logging::LOG_WARNING); if (!ValidateWidevineCryptoFlags() || !ValidateRawKeyCryptoFlags() || !ValidatePRCryptoFlags()) { @@ -530,7 +533,8 @@ int PackagerMain(int argc, char** argv) { LOG(ERROR) << "Packaging Error: " << status.ToString(); return kPackagingFailed; } - printf("Packaging completed successfully.\n"); + if (!FLAGS_quiet) + printf("Packaging completed successfully.\n"); return kSuccess; }