From cc4927b6929645dba67fe647195c9ae0d83a5b14 Mon Sep 17 00:00:00 2001 From: crusader Date: Thu, 30 Nov 2017 15:43:19 +0900 Subject: [PATCH] ing --- servlet.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/servlet.go b/servlet.go index 71fcebc..ea0f7d9 100644 --- a/servlet.go +++ b/servlet.go @@ -120,6 +120,8 @@ func (s *rpcServlet) Context() ServletContext { func handleServlet(s *rpcServlet) { var err error + logging.Logger().Info(fmt.Sprintf("Servlet is started")) + defer func() { s.doneChan <- err s.stopWg.Done() @@ -152,8 +154,12 @@ func handleServlet(s *rpcServlet) { } func handleReader(s *rpcServlet, stopChan chan struct{}, doneChan chan error) { + logging.Logger().Debug(fmt.Sprintf("reader of Servlet is started")) + var err error defer func() { + logging.Logger().Debug(fmt.Sprintf("reader of Servlet is stopped")) + if r := recover(); r != nil { if err == nil { err = fmt.Errorf("RPC Server: Panic when reading request from client: %v", r) @@ -191,8 +197,11 @@ func handleReader(s *rpcServlet, stopChan chan struct{}, doneChan chan error) { } func handleWriter(s *rpcServlet, stopChan chan struct{}, doneChan chan error) { + logging.Logger().Debug(fmt.Sprintf("writer of Servlet is started")) + var err error defer func() { + logging.Logger().Debug(fmt.Sprintf("writer of Servlet is stopped")) if r := recover(); r != nil { if err == nil { err = fmt.Errorf("RPC Server: Panic when writing response to client: %v", r)