Browse Source

Added back debug logs to Spoolbuddy test scripts

maziggy 2 months ago
parent
commit
f96d211612
2 changed files with 8 additions and 0 deletions
  1. 4 0
      spoolbuddy/scripts/read_tag.py
  2. 4 0
      spoolbuddy/scripts/scale_diag.py

+ 4 - 0
spoolbuddy/scripts/read_tag.py

@@ -7,6 +7,7 @@ spoolbuddy/daemon/pn5180.py and is imported from there.
 Supports: Bambu (MIFARE Classic) + NTAG (SpoolEase/OpenPrintTag)
 """
 
+import logging
 import sys
 import time
 from pathlib import Path
@@ -15,6 +16,9 @@ from pathlib import Path
 sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
 from daemon.pn5180 import BAMBU_BLOCKS, PN5180
 
+# Show driver debug output during diagnostics
+logging.basicConfig(level=logging.DEBUG, format="  %(message)s")
+
 
 def _print_hex_dump(data: bytes, label: str, bytes_per_line: int = 16):
     """Print a hex dump with ASCII sidebar."""

+ 4 - 0
spoolbuddy/scripts/scale_diag.py

@@ -5,6 +5,7 @@ Standalone diagnostic script — the NAU7802 driver lives in
 spoolbuddy/daemon/nau7802.py and is imported from there.
 """
 
+import logging
 import sys
 import time
 from pathlib import Path
@@ -15,6 +16,9 @@ import smbus2
 sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
 from daemon.nau7802 import I2C_BUS, NAU7802, NAU7802_ADDR
 
+# Show driver debug output (init steps, etc.) during diagnostics
+logging.basicConfig(level=logging.DEBUG, format="  %(message)s")
+
 
 def main():
     print("=" * 60)