diff --git a/packager/app/mpd_generator.cc b/packager/app/mpd_generator.cc index ee9de0f810..e4cec7ed48 100644 --- a/packager/app/mpd_generator.cc +++ b/packager/app/mpd_generator.cc @@ -31,6 +31,9 @@ ABSL_FLAG(std::string, "", "Packager version for testing. Should be used for testing only."); +// From absl/log: +ABSL_DECLARE_FLAG(int, stderrthreshold); + namespace shaka { namespace { const char kUsage[] = @@ -109,6 +112,13 @@ int MpdMain(int argc, char** argv) { auto usage = absl::StrFormat(kUsage, argv[0]); absl::SetProgramUsageMessage(usage); + + // Before parsing the command line, change the default value of some flags + // provided by libraries. + + // Always log to stderr. Log levels are still controlled by --minloglevel. + absl::SetFlag(&FLAGS_stderrthreshold, 0); + absl::ParseCommandLine(argc, argv); if (absl::GetFlag(FLAGS_licenses)) { diff --git a/packager/app/packager_main.cc b/packager/app/packager_main.cc index 426a2352df..97a4fccd71 100644 --- a/packager/app/packager_main.cc +++ b/packager/app/packager_main.cc @@ -58,6 +58,9 @@ ABSL_FLAG(bool, false, "If enabled, only use one thread when generating content."); +// From absl/log: +ABSL_DECLARE_FLAG(int, stderrthreshold); + namespace shaka { namespace { @@ -560,6 +563,12 @@ int PackagerMain(int argc, char** argv) { auto usage = absl::StrFormat(kUsage, argv[0]); absl::SetProgramUsageMessage(usage); + // Before parsing the command line, change the default value of some flags + // provided by libraries. + + // Always log to stderr. Log levels are still controlled by --minloglevel. + absl::SetFlag(&FLAGS_stderrthreshold, 0); + auto remaining_args = absl::ParseCommandLine(argc, argv); if (absl::GetFlag(FLAGS_licenses)) { for (const char* line : kLicenseNotice)