Skip to content

Commit bb1637e

Browse files
QuakeStringclaude
andcommitted
Promote optimization logs to INFO level for visibility
Auto-tune, PDU negotiation, and plan-built messages are now INFO so they appear in gateway logs without requiring DEBUG on snap7 logger. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 57f6396 commit bb1637e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

snap7/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def _auto_tune_parallel(self) -> None:
237237
# Leave headroom: use at most half the PLC's connection
238238
# slots for parallel reads (other clients may need slots).
239239
self.max_parallel = max(1, min(max_conn // 2, 8))
240-
logger.debug(f"Auto-tuned max_parallel={self.max_parallel} (PLC MaxConnections={max_conn})")
240+
logger.info(f"Auto-tuned max_parallel={self.max_parallel} (PLC MaxConnections={max_conn})")
241241
return
242242
except Exception:
243243
pass # SZL not supported — fall back to PDU heuristic
@@ -250,7 +250,7 @@ def _auto_tune_parallel(self) -> None:
250250
else:
251251
self.max_parallel = 1 # Very small PDU — sequential only
252252

253-
logger.debug(f"Auto-tuned max_parallel={self.max_parallel} (PDU={self.pdu_length})")
253+
logger.info(f"Auto-tuned max_parallel={self.max_parallel} (PDU={self.pdu_length})")
254254

255255
def connect(self, address: str, rack: int, slot: int, tcp_port: int = 102) -> "Client":
256256
"""
@@ -640,7 +640,7 @@ def _read_multi_optimized(self, items: List[dict[str, Any]]) -> List[bytearray]:
640640
self._opt_cache_read_items = read_items
641641
self._opt_cache_optimizable = optimizable
642642
self._opt_cache_fallback = fallback
643-
logger.debug(f"Optimization plan built: {len(packets)} packet(s) for {len(items)} item(s)")
643+
logger.info(f"Optimization plan built: {len(packets)} packet(s) for {len(items)} item(s)")
644644

645645
# Use cached plan
646646
packets = self._opt_cache_packets or []

0 commit comments

Comments
 (0)