Added prints on startup.
authorSebastien Douheret <sebastien.douheret@iot.bzh>
Thu, 18 May 2017 21:22:27 +0000 (23:22 +0200)
committerSebastien Douheret <sebastien.douheret@iot.bzh>
Thu, 18 May 2017 21:22:27 +0000 (23:22 +0200)
lib/xdsserver/server.go
main.go

index f0777e3..67b3e9a 100644 (file)
@@ -1,6 +1,7 @@
 package xdsserver
 
 import (
+       "fmt"
        "net/http"
 
        "github.com/Sirupsen/logrus"
@@ -91,9 +92,12 @@ func (s *ServerService) Serve() error {
        // Serve in the background
        serveError := make(chan error, 1)
        go func() {
+               fmt.Printf("Web Server running on localhost:%s ...\n", s.cfg.HTTPPort)
                serveError <- http.ListenAndServe(":"+s.cfg.HTTPPort, s.router)
        }()
 
+       fmt.Printf("XDS agent running...\n")
+
        // Wait for stop, restart or error signals
        select {
        case <-s.stop:
diff --git a/main.go b/main.go
index 0a0ad0a..eeb4036 100644 (file)
--- a/main.go
+++ b/main.go
@@ -3,6 +3,7 @@
 package main
 
 import (
+       "fmt"
        "log"
        "os"
        "time"
@@ -54,14 +55,14 @@ func xdsAgent(cliCtx *cli.Context) error {
        if err != nil {
                return cli.NewExitError(err, 2)
        }
-       ctx.Log.Infof("Syncthing started (PID %d)", ctx.SThgCmd.Process.Pid)
+       fmt.Printf("Syncthing started (PID %d)\n", ctx.SThgCmd.Process.Pid)
 
        ctx.Log.Infof("Starting Syncthing-inotify...")
        ctx.SThgInotCmd, err = ctx.SThg.StartInotify()
        if err != nil {
                return cli.NewExitError(err, 2)
        }
-       ctx.Log.Infof("Syncthing-inotify started (PID %d)", ctx.SThgInotCmd.Process.Pid)
+       fmt.Printf("Syncthing-inotify started (PID %d)\n", ctx.SThgInotCmd.Process.Pid)
 
        // Establish connection with local Syncthing (retry if connection fail)
        time.Sleep(3 * time.Second)