finer grained logging of Chromium launch sequence (#135078)

Log the details of how Chromium is about to be launched prior to running
the Chromium command, as well as the path to the Chromium executable.

This should improve our understanding of what's happening here:
https://github.com/flutter/flutter/issues/132654#issuecomment-1726630123
This commit is contained in:
Yegor
2023-09-20 15:20:16 -07:00
committed by GitHub
parent b433b17539
commit d6d2e89fc8
2 changed files with 77 additions and 28 deletions

View File

@@ -171,14 +171,23 @@ class ChromiumLauncher {
throwToolExit('Only one instance of chrome can be started.');
}
if (_logger.isVerbose) {
_logger.printTrace('Launching Chromium (url = $url, headless = $headless, skipCheck = $skipCheck, debugPort = $debugPort)');
}
final String chromeExecutable = _browserFinder(_platform, _fileSystem);
if (_logger.isVerbose && !_platform.isWindows) {
// The "--version" argument is not supported on Windows.
final ProcessResult versionResult = await _processManager.run(<String>[chromeExecutable, '--version']);
_logger.printTrace('Using ${versionResult.stdout}');
if (_logger.isVerbose) {
_logger.printTrace('Will use Chromium executable at $chromeExecutable');
if (!_platform.isWindows) {
// The "--version" argument is not supported on Windows.
final ProcessResult versionResult = await _processManager.run(<String>[chromeExecutable, '--version']);
_logger.printTrace('Using ${versionResult.stdout}');
}
}
final Directory userDataDir = _fileSystem.systemTempDirectory
.createTempSync('flutter_tools_chrome_device.');