robocanic commented on code in PR #1340:
URL: https://github.com/apache/dubbo-admin/pull/1340#discussion_r2448644751
##########
pkg/diagnostics/server.go:
##########
@@ -79,31 +76,30 @@ func (s *diagnosticsServer) Start(_ runtime.Runtime, stop
<-chan struct{}) error
Addr: fmt.Sprintf(":%d", s.config.ServerPort),
Handler: mux,
ReadHeaderTimeout: time.Second,
- ErrorLog: adapter.ToStd(diagnosticsServerLog),
}
- diagnosticsServerLog.Info("starting diagnostic server", "interface",
"0.0.0.0", "port", s.config.ServerPort)
+ logger.Infof("starting diagnostic server, endpoint is 0.0.0.0: %d",
s.config.ServerPort)
errChan := make(chan error)
go func() {
defer close(errChan)
var err error
err = httpServer.ListenAndServe()
if err != nil {
- switch err {
- case http.ErrServerClosed:
- diagnosticsServerLog.Info("shutting down
server")
+ switch {
+ case errors.Is(err, http.ErrServerClosed):
+ logger.Errorf("diagnostics http server closed,
err: %s", err)
default:
- diagnosticsServerLog.Error(err, "could not
start HTTP Server")
+ logger.Error("could not start diagnostics http
Server, unknown err: %s", err)
Review Comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]