add --verbose flag and CASE_DEBUG env var, for debugging
This commit is contained in:
5
main.py
5
main.py
@@ -104,6 +104,7 @@ def main() -> None:
|
|||||||
logging.getLogger().setLevel(logging.INFO)
|
logging.getLogger().setLevel(logging.INFO)
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="toplevel cadquery interface")
|
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", 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("--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'")
|
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()
|
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()
|
config = Config.from_env()
|
||||||
|
|
||||||
if args.render_phone:
|
if args.render_phone:
|
||||||
|
Reference in New Issue
Block a user