From 32d0396ebd8a3e66d5a84f73f82264ec819144c6 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Sat, 12 Oct 2019 10:30:31 -0400 Subject: [PATCH] Update hostname example --- example/hostname.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/example/hostname.dart b/example/hostname.dart index bd6bcad8..80628642 100644 --- a/example/hostname.dart +++ b/example/hostname.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:angel_framework/angel_framework.dart'; import 'package:angel_framework/http.dart'; import 'package:logging/logging.dart'; +import 'package:pretty_logging/pretty_logging.dart'; Future apiConfigurer(Angel app) async { app.get('/', (req, res) => 'Hello, API!'); @@ -16,7 +17,8 @@ Future frontendConfigurer(Angel app) async { main() async { // Logging set up/boilerplate - Logger.root.onRecord.listen(print); + hierarchicalLoggingEnabled = true; + Logger.root.onRecord.listen(prettyLog); var app = Angel(logger: Logger('angel')); var http = AngelHttp(app); @@ -39,5 +41,7 @@ main() async { await http.startServer('127.0.0.1', 3000); print('Listening at ${http.uri}'); - print('(See what happens when you visit http://localhost:3000 instead)'); + print('See what happens when you visit http://localhost:3000 instead ' + 'of http://127.0.0.1:3000. Then, try ' + 'http://api.localhost:3000.'); }