From 0b11ac01dbc8f2816afe869345d82827a2c70dc2 Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Sun, 3 Aug 2014 08:10:52 +0200 Subject: [PATCH] Shorten log about started server and accepted client a bit. --- main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 926e861..fe6dffc 100644 --- a/main.go +++ b/main.go @@ -257,6 +257,7 @@ func main() { log.Fatal(err) } defer listener.Close() + log.Printf("Server started at %s", listener.Addr()) connChan := make(chan net.Conn) defer close(connChan) @@ -264,13 +265,12 @@ func main() { signal.Notify(sigChan, os.Interrupt, os.Kill) go func() { - log.Println("Server started") for { conn, err := listener.Accept() if err != nil { log.Fatal(err) } - log.Printf("Client accepted: %s", conn) + log.Printf("Client accepted from: %s", conn.RemoteAddr()) connChan <- conn } }() @@ -278,7 +278,6 @@ func main() { for { select { case conn := <-connChan: - log.Printf("New connection %s", conn) go newConnection(conn, db).run() case <-sigChan: log.Println("Shutting down")