Skip to content

Commit caa19ba

Browse files
authored
Merge pull request #196 from taleshape-com/dev-log-url
Dev Mode: Log URL when opening it in browser
2 parents 60d347b + 6d9fa7e commit caa19ba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/dev/watch.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ func (d *Dev) handleDashboardFile(absWatchDir, p string) {
238238
fmt.Printf("Recreated expired dashboard for '%s%s'\n", fPath, name)
239239

240240
url := fmt.Sprintf("%s/dashboards/%s?dev=ws://localhost:%d/ws", d.baseURL, dashboardID, d.port)
241+
fmt.Fprintf(os.Stdout, "Opening %s ...\n", url)
241242
if err := OpenURL(url); err != nil {
242243
fmt.Printf("ERROR: Failed opening '%s' in browser: %s\n", url, err)
243244
}
@@ -255,6 +256,7 @@ func (d *Dev) handleDashboardFile(absWatchDir, p string) {
255256
notified := d.notifyClients(dashboardID)
256257
if !notified {
257258
url := fmt.Sprintf("%s/dashboards/%s?dev=ws://localhost:%d/ws", d.baseURL, dashboardID, d.port)
259+
fmt.Fprintf(os.Stdout, "Opening %s ...\n", url)
258260
if err := OpenURL(url); err != nil {
259261
fmt.Printf("ERROR: Failed opening '%s' in browser: %s\n", url, err)
260262
}
@@ -277,6 +279,7 @@ func (d *Dev) handleDashboardFile(absWatchDir, p string) {
277279
fmt.Printf("Created new dashboard for '%s%s'\n", fPath, name)
278280

279281
url := fmt.Sprintf("%s/dashboards/%s?dev=ws://localhost:%d/ws", d.baseURL, dashboardID, d.port)
282+
fmt.Fprintf(os.Stdout, "Opening %s ...\n", url)
280283
if err := OpenURL(url); err != nil {
281284
fmt.Printf("ERROR: Failed opening '%s' in browser: %s\b", url, err)
282285
}

0 commit comments

Comments
 (0)