Add option to stream logs to file for flutter logs and way to use it in devicelab runs (#84008)

This commit is contained in:
Dan Field
2021-06-07 10:33:00 -07:00
committed by GitHub
parent de9d484287
commit 5cc7b6c3ea
143 changed files with 306 additions and 175 deletions

View File

@@ -22,14 +22,11 @@ class HostAgent {
final FileSystem _fileSystem;
/// Creates a directory to dump file artifacts.
Directory get dumpDirectory {
Directory/*?*/ get dumpDirectory {
if (_dumpDirectory == null) {
// Set in LUCI recipe.
final String directoryPath = _platform.environment['FLUTTER_LOGS_DIR'];
if (directoryPath == null) {
_dumpDirectory = _fileSystem.systemTempDirectory.createTempSync('flutter_test_logs.');
print('Created tmp dump directory ${_dumpDirectory.path}');
} else {
if (directoryPath != null) {
_dumpDirectory = _fileSystem.directory(directoryPath)..createSync(recursive: true);
print('Found FLUTTER_LOGS_DIR dump directory ${_dumpDirectory.path}');
}
@@ -37,7 +34,7 @@ class HostAgent {
return _dumpDirectory;
}
static Directory _dumpDirectory;
static Directory/*?*/ _dumpDirectory;
@visibleForTesting
void resetDumpDirectory() {