Add --quiet to suppress LOG(INFO) outputs

Closes #661.

Change-Id: Ic75479fba4f8dc26146b42b85ab95af6151302b6
This commit is contained in:
KongQun Yang 2019-10-07 22:56:42 -07:00
parent ab8fa87d18
commit b70da0ed93
2 changed files with 6 additions and 1 deletions

View File

@ -36,6 +36,7 @@ Synopsis
$ packager <stream_descriptor> ... \ $ packager <stream_descriptor> ... \
[--dump_stream_info] \ [--dump_stream_info] \
[--quiet] \
[Chunking Options] \ [Chunking Options] \
[MP4 Output Options] \ [MP4 Output Options] \
[encryption / decryption options] \ [encryption / decryption options] \

View File

@ -39,6 +39,7 @@
DEFINE_bool(dump_stream_info, false, "Dump demuxed stream info."); DEFINE_bool(dump_stream_info, false, "Dump demuxed stream info.");
DEFINE_bool(licenses, false, "Dump licenses."); DEFINE_bool(licenses, false, "Dump licenses.");
DEFINE_bool(quiet, false, "When enabled, LOG(INFO) output is suppressed.");
DEFINE_bool(use_fake_clock_for_muxer, DEFINE_bool(use_fake_clock_for_muxer,
false, false,
"Set to true to use a fake clock for muxer. With this flag set, " "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"); google::ShowUsageWithFlags("Usage");
return kSuccess; return kSuccess;
} }
if (FLAGS_quiet)
logging::SetMinLogLevel(logging::LOG_WARNING);
if (!ValidateWidevineCryptoFlags() || !ValidateRawKeyCryptoFlags() || if (!ValidateWidevineCryptoFlags() || !ValidateRawKeyCryptoFlags() ||
!ValidatePRCryptoFlags()) { !ValidatePRCryptoFlags()) {
@ -530,6 +533,7 @@ int PackagerMain(int argc, char** argv) {
LOG(ERROR) << "Packaging Error: " << status.ToString(); LOG(ERROR) << "Packaging Error: " << status.ToString();
return kPackagingFailed; return kPackagingFailed;
} }
if (!FLAGS_quiet)
printf("Packaging completed successfully.\n"); printf("Packaging completed successfully.\n");
return kSuccess; return kSuccess;
} }