From 61bb19e64a683bb0eaf70bf81a8309e2ffc33a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flc=E3=82=9B?= Date: Sun, 7 Jan 2024 22:23:24 +0800 Subject: [PATCH] feat(gin): Added some log information (#63) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Flcă‚› --- gin/server.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gin/server.go b/gin/server.go index 04ec56a..7c1d9a0 100644 --- a/gin/server.go +++ b/gin/server.go @@ -5,6 +5,7 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/go-kratos/kratos/v2/log" ) type Server struct { @@ -42,9 +43,11 @@ func NewServer(e *gin.Engine, opts ...Option) *Server { } func (s *Server) Start(_ context.Context) error { + log.Infof("[GIN] server listening on: %s", s.addr) return s.server.ListenAndServe() } func (s *Server) Stop(ctx context.Context) error { + log.Info("[GIN] server stopping") return s.server.Shutdown(ctx) }