add --verbose flag and CASE_DEBUG env var, for debugging

This commit is contained in:
2025-04-11 16:47:23 +00:00
parent e414dcd704
commit 175af78659

View File

@@ -104,6 +104,7 @@ def main() -> None:
logging.getLogger().setLevel(logging.INFO)
parser = argparse.ArgumentParser(description="toplevel cadquery interface")
parser.add_argument("--verbose", action="store_true", help="debug-level logging")
parser.add_argument("--render-phone", action="store_true", help="render the case and also the phone within it; useful to confirm fit visually before printing")
parser.add_argument("--render-phone-only", action="store_true", help="render *only* the phone, not even the case")
parser.add_argument("--battery", choices=["none", "ldtek"], help="name of the battery for which to create a pocket cutout, or 'none'")
@@ -114,6 +115,10 @@ def main() -> None:
args = parser.parse_args()
if args.verbose or os.environ.get("CASE_DEBUG"):
logging.getLogger().setLevel(logging.DEBUG)
logger.debug("enabled debug-level logging")
config = Config.from_env()
if args.render_phone: