Skip to content

Commit

Permalink
refactor: logging
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeCrassous committed Apr 14, 2021
1 parent fbd9f2a commit 26b7e75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions mixer/blender_data/armature_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, do: Callable[[], None], undo: Callable[[], None], text: str):
self._text = text

def do(self):
logger.info("DO " + self._text)
# logger.info("DO " + self._text)
try:
self._do()
except Exception as e:
Expand All @@ -70,7 +70,7 @@ def do(self):
logger.error(f"... {e!r}")

def undo(self):
logger.info("UNDO " + self._text)
# logger.info("UNDO " + self._text)
try:
self._undo()
except Exception as e:
Expand All @@ -90,16 +90,16 @@ def append(self, command: Command):
self._commands.append(command)

def do(self):
if self._commands and self._text:
logger.info("DO -- begin " + self._text)
# if self._commands and self._text:
# logger.info("DO -- begin " + self._text)
for command in self._commands:
command.do()

def undo(self):
for command in reversed(self._commands):
command.undo()
if self._commands and self._text:
logger.info("UNDO -- end " + self._text)
# if self._commands and self._text:
# logger.info("UNDO -- end " + self._text)


def override_context():
Expand Down
3 changes: 2 additions & 1 deletion mixer/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def handler_send_frame_changed(scene):
def handler_send_scene_data_to_server(scene, dummy):
global processing_depsgraph_handler
if processing_depsgraph_handler:
logger.error("Depsgraph handler recursion attempt")
# this happens when an operator is called during the depsgraph handler processing, which is common with armatures
logger.debug("Depsgraph handler recursion attempt (safe with armatures)")
return

processing_depsgraph_handler = True
Expand Down

0 comments on commit 26b7e75

Please sign in to comment.