flutter/packages/flutter_tools/test/general.shard/base
James D. Lin e4206ac5dd
[flutter tools] Add a DelegatingLogger class (#67581)
[flutter tools] Add a DelegatingLogger class

Move most of `DelegateLogger` `from test/src/testbed.dart` to
`lib/src/base/logger.dart` to better formalize the common practice of
chaining `Logger`s together.  I renamed the class since it isn't
itself the delegate and to better match the `Delegating...` classes
from `package:collection`.

Additionally, add a freestanding `asLogger<T>` function to "cast" a
`Logger` into a matching delegate if possible.  This will allow
`Logger` chains to be ordered a *bit* more freely (e.g.
`NotifyingLogger` and `AppRunLogger` will no longer required to be
at the end of the chain, an unwritten rule that has led to breakage in
google3).  Chain order still matters since lack of virtual dispatch
means that parent `Logger`s can never invoke child methods, however.

I made `asLogger<T>` a freestanding function because I didn't want to
make it part of the `Logger` interface (and I thought that making it
an extension method might be weird).

Bonus cleanup:
There no longer appears to be a way to construct an `AppRunLogger`
with a null parent, so remove all of code paths for that case and
make the `parent` construction parameter required.
2020-10-09 15:55:24 -07:00
..
analyze_size_test.dart [flutter_tools] add analytics to code size, add more testing (#64578) 2020-08-27 09:45:10 -07:00
async_guard_test.dart [flutter_tools] move to fake_async, skip failing tests (#63536) 2020-08-11 19:36:05 -07:00
bot_detector_test.dart [flutter_tools] handle OsError thrown during azure detector (#64749) 2020-08-27 17:13:04 -07:00
build_test.dart Replace MockArtifacts with Artifacts.test() (#67012) 2020-09-30 16:25:29 -07:00
command_help_test.dart Optionally invert oversized images (#61209) 2020-07-13 14:03:23 -07:00
common_test.dart revert #48985 (#49572) 2020-01-27 14:36:02 -08:00
context_test.dart License update (#45373) 2019-11-27 15:04:02 -08:00
error_handling_io_test.dart [flutter_tools] handle case where file is deleted by other program or running on read only volume (#66708) 2020-10-05 17:00:07 -07:00
file_system_test.dart [flutter_tools] handle case where file is deleted by other program or running on read only volume (#66708) 2020-10-05 17:00:07 -07:00
fingerprint_test.dart [flutter_tools] shrink fingerprinter API to currently used subset (#63840) 2020-08-18 17:01:06 -07:00
io_test.dart Replace MockFile with memory file system files (#66941) 2020-09-29 17:50:33 -07:00
logger_test.dart [flutter tools] Add a DelegatingLogger class (#67581) 2020-10-09 15:55:24 -07:00
logs_test.dart [flutter_tools] last pass on general.shard unit tests (#60263) 2020-06-26 13:36:06 -07:00
net_test.dart Replace MockFile with memory file system files (#66941) 2020-09-29 17:50:33 -07:00
os_test.dart Remove the .zip method from OSUtils, as it was not used (#67367) 2020-10-08 13:40:01 -07:00
os_utils_test.dart [flutter_tools] remove globals from base/android (#60480) 2020-06-29 15:06:58 -07:00
platform_test.dart [flutter_tools] Restore base/platform.dart (#56410) 2020-05-06 08:15:39 -07:00
process_test.dart [flutter_tools] move to fake_async, skip failing tests (#63536) 2020-08-11 19:36:05 -07:00
signals_test.dart [flutter_tools] Delete system temp entries on fatal signals (#55513) 2020-05-14 14:27:02 -07:00
terminal_test.dart Remove unused 'dart:async' imports. (#65568) 2020-09-16 14:14:06 -07:00
user_messages_test.dart Updated androidMissingSdkInstructions error message (#65964) 2020-09-17 15:57:06 -07:00