1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-01 00:55:04 +02:00

moved log message to start server

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2016-11-04 20:58:30 -07:00
parent 409c5a42b7
commit 00ae708f49

View File

@ -505,7 +505,6 @@ func (e *Echo) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// Start starts the HTTP server. // Start starts the HTTP server.
func (e *Echo) Start(address string) error { func (e *Echo) Start(address string) error {
e.Color.Printf(" ⇛ http server started on %s\n", color.Green(address))
return e.StartServer(&http.Server{Addr: address}) return e.StartServer(&http.Server{Addr: address})
} }
@ -520,7 +519,6 @@ func (e *Echo) StartTLS(address string, certFile, keyFile string) (err error) {
if err != nil { if err != nil {
return return
} }
e.Color.Printf(" ⇛ https server started on %s\n", color.Green(address))
return e.startTLS(address, config) return e.startTLS(address, config)
} }
@ -533,7 +531,6 @@ func (e *Echo) StartAutoTLS(hosts []string, cacheFile string) (err error) {
if err = e.tlsManager.CacheFile(cacheFile); err != nil { if err = e.tlsManager.CacheFile(cacheFile); err != nil {
return return
} }
e.Color.Printf(" ⇛ https auto https server started on %s\n", color.Green(address))
return e.startTLS(address, config) return e.startTLS(address, config)
} }
@ -557,8 +554,10 @@ func (e *Echo) StartServer(s *http.Server) error {
} }
if s.TLSConfig == nil { if s.TLSConfig == nil {
e.server = gs e.server = gs
e.Color.Printf(" ⇛ http server started on %s\n", color.Green(s.Addr))
} else { } else {
e.tlsServer = gs e.tlsServer = gs
e.Color.Printf(" ⇛ https server started on %s\n", color.Green(s.Addr))
} }
return gs.ListenAndServe() return gs.ListenAndServe()
} }