feat: bring --enable-logging functionality in line with Chromium (#25089)

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
This commit is contained in:
Charles Kerr 2021-06-17 16:17:25 -05:00 committed by GitHub
parent c841247815
commit 8ccab4ce91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 553 additions and 54 deletions

View file

@ -45,6 +45,7 @@
#include "shell/common/application_info.h"
#include "shell/common/electron_paths.h"
#include "shell/common/gin_helper/trackable_object.h"
#include "shell/common/logging.h"
#include "shell/common/node_bindings.h"
#include "shell/common/node_includes.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
@ -269,6 +270,11 @@ void ElectronBrowserMainParts::PostEarlyInitialization() {
// Initialize field trials.
InitializeFieldTrials();
// Reinitialize logging now that the app has had a chance to set the app name
// and/or user data directory.
logging::InitElectronLogging(*base::CommandLine::ForCurrentProcess(),
/* is_preinit = */ false);
// Initialize after user script environment creation.
fake_browser_process_->PostEarlyInitialization();
}