Skip to content

Commit

Permalink
Update engine.py (#79)
Browse files Browse the repository at this point in the history
It's probably bad practice to permanently change hiero's log level just to print a sg debug log.
HieroPlayer doesn't have a frameserver, so the warning in this file fires every second : /apps/foundry/nuke/Nuke12.2v4/pythonextensions/site-packages/hiero/ui/FnStatusBar.py
To prevent this, we need to revert hiero's log level to what it was before we emit a debug level message.
  • Loading branch information
reformstudios authored Jan 10, 2025
1 parent 7aa5b1d commit 9d199ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,8 @@ def _emit_log_message(self, handler, record):
if self.hiero_enabled:
import hiero

existing_log_level = hiero.core.log.logLevel()

if record.levelno >= logging.ERROR:
hiero.core.log.error(msg)
elif record.levelno >= logging.WARNING:
Expand All @@ -707,6 +709,7 @@ def _emit_log_message(self, handler, record):
else:
hiero.core.log.setLogLevel(hiero.core.log.kDebug)
hiero.core.log.debug(msg)
hiero.core.log.setLogLevel(existing_log_level)
else:
if record.levelno >= logging.CRITICAL:
nuke.critical("PTR Critical: %s" % msg)
Expand Down

0 comments on commit 9d199ce

Please sign in to comment.