[flutter_tools] Add test that "Unresolve URI" warnings from DWDS are filtered from logs (#102399)

This commit is contained in:
Christopher Fujino
2022-04-22 15:29:07 -07:00
committed by GitHub
parent a3a9a23e46
commit 5a3e10047f
2 changed files with 33 additions and 2 deletions

View File

@@ -275,7 +275,7 @@ class WebAssetServer implements AssetReader {
}
logging.Logger.root.level = logging.Level.ALL;
logging.Logger.root.onRecord.listen(_log);
logging.Logger.root.onRecord.listen(log);
// In debug builds, spin up DWDS and the full asset server.
final Dwds dwds = await dwdsLauncher(
@@ -1004,7 +1004,8 @@ class ReleaseAssetServer {
}
}
void _log(logging.LogRecord event) {
@visibleForTesting
void log(logging.LogRecord event) {
final String error = event.error == null? '': 'Error: ${event.error}';
if (event.level >= logging.Level.SEVERE) {
globals.printError('${event.loggerName}: ${event.message}$error', stackTrace: event.stackTrace);