Skip to content

Commit

Permalink
Reduce log spam, add DEBUG mode
Browse files Browse the repository at this point in the history
  • Loading branch information
voneiden committed Jun 21, 2023
1 parent 7e4fba9 commit 9648bd4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ocp_freecad_cam/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This is the user facing API of ocp_freecad_cam
"""
import logging
import os
from copy import copy
from typing import Literal, Optional

Expand Down Expand Up @@ -46,9 +47,12 @@
b3d = None

logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
Log._useConsole = False
Log._defaultLogLevel = Log.Level.DEBUG
logging.getLogger().setLevel(logging.INFO)

if os.environ.get("DEBUG", False):
logging.getLogger().setLevel(logging.DEBUG)
Log._useConsole = False
Log._defaultLogLevel = Log.Level.DEBUG


class Job:
Expand Down
5 changes: 5 additions & 0 deletions src/ocp_freecad_cam/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,14 @@ def generate_visual_commands(job):
case "G99":
canned_r = True

case "G54":
pass

case _:
if command.Name.startswith("("):
continue
if command.Name.startswith("M"):
continue
print("Unknown gcode", command.Name)
return visual_commands

Expand Down

0 comments on commit 9648bd4

Please sign in to comment.