LingxinMeng 1 年之前
父节点
当前提交
1e558b37c6
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 1 0
      aarch64/topic_echo/main/main.go
  2. 4 5
      common/gin/middleware/m_log_request.go

+ 1 - 0
aarch64/topic_echo/main/main.go

@@ -194,6 +194,7 @@ func main() {
 				Topic: topic,
 				Callback: func(data *pjisuv_msgs.PerceptionLocalization) {
 					fmt.Println("收到话题", topic, "的数据", data)
+					fmt.Println("当前 poxitionX 为", data.PositionX, ",positionY 为", data.PositionY)
 				}})
 		}
 		//13 一致

+ 4 - 5
common/gin/middleware/m_log_request.go

@@ -1,7 +1,6 @@
 package middleware
 
 import (
-	"cicv-data-closedloop/common/config/c_log"
 	"github.com/gin-gonic/gin"
 )
 
@@ -14,10 +13,10 @@ import (
 // LogRequest 中间件函数,用于打印请求方的IP地址和请求路径
 func LogRequest() gin.HandlerFunc {
 	return func(c *gin.Context) {
-		clientIP := c.ClientIP()          // 获取请求方的IP地址
-		requestPath := c.Request.URL.Path // 获取请求路径
-		// 打印请求方的IP地址和请求路径
-		c_log.GlobalLogger.Infof("客户端 %v 发送请求 %v", clientIP, requestPath)
+		//clientIP := c.ClientIP()          // 获取请求方的IP地址
+		//requestPath := c.Request.URL.Path // 获取请求路径
+		//// 打印请求方的IP地址和请求路径
+		//c_log.GlobalLogger.Infof("客户端 %v 发送请求 %v", clientIP, requestPath)
 		// 继续处理后续请求
 		c.Next()
 	}