refactor(dart/transform): Minor logging changes

Enable easier testing by providing a null log implementation and a way
to use it.
This commit is contained in:
Tim Blasi
2015-03-18 11:03:41 -07:00
committed by Misko Hevery
parent 5d479fa0ae
commit c735644c57
2 changed files with 28 additions and 0 deletions

View File

@ -10,6 +10,11 @@ void init(Transform t) {
_logger = new BuildLogger(t);
}
/// Sets [logger] directly. Used for testing - in general use [init].
void setLogger(BuildLogger logger) {
_logger = logger;
}
/// The logger the transformer should use for messaging.
BuildLogger get logger {
if (_logger == null) {