From f96d2116120e091941f77135b4eeb7de4d1a2a65 Mon Sep 17 00:00:00 2001 From: maziggy Date: Wed, 25 Mar 2026 12:13:31 +0100 Subject: [PATCH] Added back debug logs to Spoolbuddy test scripts --- spoolbuddy/scripts/read_tag.py | 4 ++++ spoolbuddy/scripts/scale_diag.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/spoolbuddy/scripts/read_tag.py b/spoolbuddy/scripts/read_tag.py index b50537a28..b8e95a65d 100644 --- a/spoolbuddy/scripts/read_tag.py +++ b/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.""" diff --git a/spoolbuddy/scripts/scale_diag.py b/spoolbuddy/scripts/scale_diag.py index 28c10a8d4..a557cb937 100644 --- a/spoolbuddy/scripts/scale_diag.py +++ b/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)