Edit bin/dev.dart for logging logic

This commit is contained in:
Tobe O 2019-04-18 12:05:40 -04:00
parent 14da50550e
commit 7773303a07

View file

@ -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}');
}