From 7773303a07f4506eee77be511fbd0947da3c0eef Mon Sep 17 00:00:00 2001 From: Tobe O Date: Thu, 18 Apr 2019 12:05:40 -0400 Subject: [PATCH] Edit bin/dev.dart for logging logic --- bin/dev.dart | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bin/dev.dart b/bin/dev.dart index 802864a..a2c4df3 100644 --- a/bin/dev.dart +++ b/bin/dev.dart @@ -8,17 +8,19 @@ import 'package:logging/logging.dart'; main() async { // Watch the config/ and web/ directories for changes, and hot-reload the server. - var hot = new HotReloader(() async { - var app = new Angel(reflector: MirrorsReflector()); + hierarchicalLoggingEnabled = true; + + var hot = HotReloader(() async { + var logger = Logger.detached('{{angel}}')..onRecord.listen(prettyLog); + var app = Angel(logger: logger, reflector: MirrorsReflector()); await app.configure(configureServer); - hierarchicalLoggingEnabled = true; - app.logger = new Logger.detached('{{angel}}')..onRecord.listen(prettyLog); return app; }, [ - new Directory('config'), - new Directory('lib'), + Directory('config'), + Directory('lib'), ]); var server = await hot.startServer('127.0.0.1', 3000); - print('{{angel}} server listening at http://${server.address.address}:${server.port}'); + print( + '{{angel}} server listening at http://${server.address.address}:${server.port}'); }