refactor: disable console logs in storage location service and WebSocket for cleaner output

This commit is contained in:
xudan 2025-09-04 14:14:43 +08:00
parent 0ffb170ec8
commit e791fa4e3c
2 changed files with 10 additions and 10 deletions

View File

@ -165,10 +165,10 @@ export class StorageLocationService {
const inner = new Map<string, StorageState>();
list.forEach((loc) => {
inner.set(loc.layer_name, { occupied: loc.is_occupied, locked: loc.is_locked });
console.log(`更新库位状态映射: ${pointId} - ${loc.layer_name}`, {
occupied: loc.is_occupied,
locked: loc.is_locked
});
// console.log(`更新库位状态映射: ${pointId} - ${loc.layer_name}`, {
// occupied: loc.is_occupied,
// locked: loc.is_locked
// });
});
storageStateMap.set(pointId, inner);
}

View File

@ -77,7 +77,7 @@ class EnhancedWebSocket {
// 🔧 优化:连接建立后立即发送一次心跳,然后开始定期心跳
if (this.ws.readyState === WebSocket.OPEN) {
console.log(`💓 连接建立后发送初始心跳: ${this.path}`);
// console.log(`💓 连接建立后发送初始心跳: ${this.path}`);
this.ws.send(WS_CONFIG.heartbeatMessage);
this.heartbeatSentCount++;
this.lastHeartbeatTime = Date.now();
@ -119,9 +119,9 @@ class EnhancedWebSocket {
if (isHeartbeatResponse) {
this.heartbeatReceivedCount++;
const responseTime = Date.now() - this.lastHeartbeatTime;
console.log(
`💗 收到心跳响应: ${this.path}, 响应时间: ${responseTime}ms, 已发送: ${this.heartbeatSentCount}, 已接收: ${this.heartbeatReceivedCount}`,
);
// console.log(
// `💗 收到心跳响应: ${this.path}, 响应时间: ${responseTime}ms, 已发送: ${this.heartbeatSentCount}, 已接收: ${this.heartbeatReceivedCount}`,
// );
// 心跳响应,不传递给业务代码
return;
}
@ -217,7 +217,7 @@ class EnhancedWebSocket {
// 心跳统计分析
if (this.heartbeatSentCount > this.heartbeatReceivedCount) {
const missedHeartbeats = this.heartbeatSentCount - this.heartbeatReceivedCount;
console.log(` └─ 心跳分析: 有${missedHeartbeats}个心跳未收到响应,可能存在网络延迟或服务器响应问题`);
// console.log(` └─ 心跳分析: 有${missedHeartbeats}个心跳未收到响应,可能存在网络延迟或服务器响应问题`);
}
}
@ -245,7 +245,7 @@ class EnhancedWebSocket {
if (this.ws.readyState === WebSocket.OPEN) {
this.heartbeatSentCount++;
this.lastHeartbeatTime = Date.now();
console.log(`💓 发送心跳: ${this.path} (#${this.heartbeatSentCount})`);
// console.log(`💓 发送心跳: ${this.path} (#${this.heartbeatSentCount})`);
this.ws.send(WS_CONFIG.heartbeatMessage);
// 只有在没有进行超时检测时才设置新的超时检测