From e9243357ae4321968c6a3eb0331c60ac3f2789f5 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Wed, 16 Jul 2014 22:22:07 +0200 Subject: [PATCH] http: Format "server running" log msg like MPD By removing the http://... URL in the log output, we hopefully remove the dubious connection between hostname/port configuration and the URL you'll actually use to browse the Mopidy web server. Example log output with this change: ... INFO Starting Mopidy frontends: HttpFrontend, MpdFrontend INFO HTTP server running at [::ffff:127.0.0.1]:6680 INFO MPD server running at [::ffff:127.0.0.1]:6600 --- mopidy/http/actor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mopidy/http/actor.py b/mopidy/http/actor.py index c9272bb6..9fd4ffca 100644 --- a/mopidy/http/actor.py +++ b/mopidy/http/actor.py @@ -14,7 +14,7 @@ import tornado.websocket from mopidy import exceptions, models, zeroconf from mopidy.core import CoreListener from mopidy.http import handlers -from mopidy.utils import encoding, formatting +from mopidy.utils import encoding, formatting, network logger = logging.getLogger(__name__) @@ -54,7 +54,8 @@ class HttpFrontend(pykka.ThreadingActor, CoreListener): def _startup(self): logger.info( - 'HTTP server running at http://%s:%s', self.hostname, self.port) + 'HTTP server running at [%s]:%s', + network.format_hostname(self.hostname), self.port) tornado.ioloop.IOLoop.instance().start() def _shutdown(self):