1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2017-01-11 15:18:04 -08:00
parent ea1c7c5ba7
commit a09afe2c97

View File

@ -50,7 +50,6 @@ import (
"sync" "sync"
"time" "time"
"github.com/labstack/gommon/color"
"github.com/labstack/gommon/log" "github.com/labstack/gommon/log"
"github.com/tylerb/graceful" "github.com/tylerb/graceful"
"golang.org/x/crypto/acme/autocert" "golang.org/x/crypto/acme/autocert"
@ -69,7 +68,6 @@ type (
ReadTimeout time.Duration ReadTimeout time.Duration
WriteTimeout time.Duration WriteTimeout time.Duration
ShutdownTimeout time.Duration ShutdownTimeout time.Duration
Color *color.Color
Logger Logger Logger Logger
stdLogger *slog.Logger stdLogger *slog.Logger
server *graceful.Server server *graceful.Server
@ -247,7 +245,6 @@ func New() (e *Echo) {
ShutdownTimeout: 15 * time.Second, ShutdownTimeout: 15 * time.Second,
Logger: log.New("echo"), Logger: log.New("echo"),
maxParam: new(int), maxParam: new(int),
Color: color.New(),
} }
e.HTTPErrorHandler = e.DefaultHTTPErrorHandler e.HTTPErrorHandler = e.DefaultHTTPErrorHandler
e.Binder = &DefaultBinder{} e.Binder = &DefaultBinder{}
@ -575,11 +572,11 @@ 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)) e.Logger.Printf("http server started on %s", s.Addr)
return gs.ListenAndServe() return gs.ListenAndServe()
} }
e.tlsServer = gs e.tlsServer = gs
e.Color.Printf(" ⇛ https server started on %s\n", color.Green(s.Addr)) e.Logger.Printf(" ⇛ https server started on %s", s.Addr)
return gs.ListenAndServeTLSConfig(s.TLSConfig) return gs.ListenAndServeTLSConfig(s.TLSConfig)
} }