Add option to stream logs to file for flutter logs and way to use it in devicelab runs (#84008)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user