From 8d0af36798520400f2f1237b605984a91f32de53 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Wed, 1 Feb 2023 11:49:31 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=85=20Produce=20warning=20instead=20of?= =?UTF-8?q?=20error=20for=20storage=20base=20url=20overrides=20(#119595)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🥅 Only log warning for storage base url * ✅ Add test * ✅ Add the link to the test * ✅ Remove the test * ✅ Remove the extra import --- packages/flutter_tools/lib/src/cache.dart | 2 +- packages/flutter_tools/test/general.shard/cache_test.dart | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart index 17a2838330..356618e46b 100644 --- a/packages/flutter_tools/lib/src/cache.dart +++ b/packages/flutter_tools/lib/src/cache.dart @@ -520,7 +520,7 @@ class Cache { if (_hasWarnedAboutStorageOverride) { return; } - _logger.printError( + _logger.printWarning( 'Flutter assets will be downloaded from $overrideUrl. Make sure you trust this source!', emphasis: true, ); diff --git a/packages/flutter_tools/test/general.shard/cache_test.dart b/packages/flutter_tools/test/general.shard/cache_test.dart index 04b0e8593a..c6628f187a 100644 --- a/packages/flutter_tools/test/general.shard/cache_test.dart +++ b/packages/flutter_tools/test/general.shard/cache_test.dart @@ -319,7 +319,7 @@ void main() { expect(() => cache.storageBaseUrl, throwsToolExit()); }); - testWithoutContext('overridden storage base url prints warning to STDERR', () async { + testWithoutContext('overridden storage base url prints warning', () async { final BufferLogger logger = BufferLogger.test(); const String baseUrl = 'https://storage.com'; final Cache cache = Cache.test( @@ -331,7 +331,7 @@ void main() { ); expect(cache.storageBaseUrl, baseUrl); - expect(logger.errorText, contains('Flutter assets will be downloaded from $baseUrl')); + expect(logger.warningText, contains('Flutter assets will be downloaded from $baseUrl')); expect(logger.statusText, isEmpty); }); });