rework logging code

This commit is contained in:
wish
2023-03-09 22:05:32 +11:00
parent b6fcc1ca14
commit dcab41a6c7
6 changed files with 86 additions and 47 deletions

View File

@@ -111,7 +111,9 @@ func (s *Server) handleEntranceServerConnection(conn net.Conn) {
return
}
s.logger.Debug("Got entrance server command:\n", zap.String("raw", hex.Dump(pkt)))
if s.erupeConfig.DevMode && s.erupeConfig.DevModeOptions.LogInboundMessages {
fmt.Printf("[Client] -> [Server]\nData [%d bytes]:\n%s\n", len(pkt), hex.Dump(pkt))
}
local := false
if strings.Split(conn.RemoteAddr().String(), ":")[0] == "127.0.0.1" {