Repository: bokeh/bokeh

Issue:
[ENH] bokeh server to show URL
It would be convenient for novice users and for teaching settings if the URL to a Bokeh server instance were displayed in the initial logging output when `bokeh serve --show foo.py` is run.

Right now I get:

```log
$ bokeh serve --show app.py
2016-11-01 05:43:18,119 Starting Bokeh server version 0.12.2
2016-11-01 05:43:18,125 Starting Bokeh server on port 5006 with applications at paths ['/app']
2016-11-01 05:43:18,125 Starting Bokeh server with process id: 5668
2016-11-01 05:43:18,576 200 GET /app (::1) 52.08ms
```

And I would like to have a line in there that said something like:

```
2016-11-01 05:43:18,432 Bokeh server available at http://localhost:5006/app
```

(or whatever the correct top-level entry point URL is for the server instance)


Discussion:
If you'd like to update the current logging in a small PR, this is where the current message is:

https://github.com/bokeh/bokeh/blob/master/bokeh/command/subcommands/serve.py#L573-L576

Just be aware that you'll need to loop and print all of them, since a server can be started with multiple apps at once. 


Resolving patch:
diff --git a/bokeh/command/subcommands/serve.py b/bokeh/command/subcommands/serve.py
--- a/bokeh/command/subcommands/serve.py
+++ b/bokeh/command/subcommands/serve.py
@@ -554,14 +554,13 @@ def show_callback():
                         server.show(route)
                 server.io_loop.add_callback(show_callback)
 
-            address_string = ''
+            address_string = 'localhost'
             if server.address is not None and server.address != '':
-                address_string = ' address ' + server.address
+                address_string = server.address
 
-            log.info("Starting Bokeh server on port %d%s with applications at paths %r",
-                     server.port,
-                     address_string,
-                     sorted(applications.keys()))
+            for route in sorted(applications.keys()):
+                url = "http://%s:%d%s%s" % (address_string, server.port, server.prefix, route)
+                log.info("Bokeh app running at: %s" % url)
 
             log.info("Starting Bokeh server with process id: %d" % getpid())
             server.run_until_shutdown()
diff --git a/bokeh/server/server.py b/bokeh/server/server.py
--- a/bokeh/server/server.py
+++ b/bokeh/server/server.py
@@ -278,6 +278,12 @@ def show(self, app_path, browser=None, new='tab'):
         '''
         if not app_path.startswith("/"):
             raise ValueError("app_path must start with a /")
+
+
+        address_string = 'localhost'
+        if self.address is not None and self.address != '':
+            address_string = self.address
+        url = "http://%s:%d%s%s" % (address_string, self.port, self.prefix, app_path)
+
         from bokeh.util.browser import view
-        url = "http://localhost:%d%s%s" % (self.port, self.prefix, app_path)
         view(url, browser=browser, new=new)


Test patch:
diff --git a/bokeh/command/subcommands/tests/test_serve.py b/bokeh/command/subcommands/tests/test_serve.py
--- a/bokeh/command/subcommands/tests/test_serve.py
+++ b/bokeh/command/subcommands/tests/test_serve.py
@@ -255,7 +255,7 @@ def test_port_not_available():
 
 def test_actual_port_printed_out():
     with run_bokeh_serve(["--port", "0"]) as p:
-        pat = re.compile(r'Starting Bokeh server on port (\d+) with applications at paths')
+        pat = re.compile(r'Bokeh app running at: http://localhost:(\d+)')
         while True:
             line = p.stdout.readline()
             print("child stdout>", line)