mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 13:52:15 +01:00
OP-2765 - added helper logging function
This commit is contained in:
parent
05867fb5c3
commit
97b9b035db
4 changed files with 18 additions and 19 deletions
|
|
@ -59,7 +59,6 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender):
|
|||
family = inst.data["family"]
|
||||
if family != "render":
|
||||
continue
|
||||
self._debug_log(inst)
|
||||
|
||||
item_id = inst.data["members"][0]
|
||||
|
||||
|
|
@ -127,12 +126,11 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender):
|
|||
|
||||
is_local = "renderLocal" in inst.data["families"]
|
||||
if inst.data.get("creator_attributes"):
|
||||
is_local = inst.data["creator_attributes"].get("farm")
|
||||
is_local = not inst.data["creator_attributes"].get("farm")
|
||||
if is_local:
|
||||
# for local renders
|
||||
instance = self._update_for_local(instance, project_entity)
|
||||
|
||||
self.log.info("New instance:: {}".format(instance))
|
||||
instances.append(instance)
|
||||
instances_to_remove.append(inst)
|
||||
|
||||
|
|
@ -224,12 +222,3 @@ class CollectAERender(abstract_collect_render.AbstractCollectRender):
|
|||
break
|
||||
|
||||
return instance
|
||||
|
||||
def _debug_log(self, instance):
|
||||
def _default_json(value):
|
||||
return str(value)
|
||||
|
||||
import json
|
||||
self.log.info(
|
||||
json.dumps(instance.data, indent=4, default=_default_json)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ import os
|
|||
from avalon import api
|
||||
import pyblish.api
|
||||
|
||||
from openpype.lib import debug_log_instance
|
||||
|
||||
|
||||
class CollectWorkfile(pyblish.api.ContextPlugin):
|
||||
""" Adds the AE render instances """
|
||||
|
|
@ -61,8 +63,6 @@ class CollectWorkfile(pyblish.api.ContextPlugin):
|
|||
|
||||
# adding basic script data
|
||||
instance.data.update(shared_instance_data)
|
||||
else:
|
||||
instance.data.update({"version": version})
|
||||
|
||||
# creating representation
|
||||
representation = {
|
||||
|
|
@ -74,7 +74,4 @@ class CollectWorkfile(pyblish.api.ContextPlugin):
|
|||
|
||||
instance.data["representations"].append(representation)
|
||||
|
||||
self.log.info('Publishing After Effects workfile')
|
||||
|
||||
for i in context:
|
||||
self.log.debug(f"{i.data['families']}")
|
||||
debug_log_instance(self.log, "Workfile instance", instance)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ from .execute import (
|
|||
path_to_subprocess_arg,
|
||||
CREATE_NO_WINDOW
|
||||
)
|
||||
from .log import PypeLogger, timeit
|
||||
from .log import PypeLogger, timeit, debug_log_instance
|
||||
|
||||
from .path_templates import (
|
||||
merge_dict,
|
||||
|
|
@ -313,6 +313,7 @@ __all__ = [
|
|||
"OpenPypeMongoConnection",
|
||||
|
||||
"timeit",
|
||||
"debug_log_instance",
|
||||
|
||||
"is_overlapping_otio_ranges",
|
||||
"otio_range_with_handles",
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import time
|
|||
import traceback
|
||||
import threading
|
||||
import copy
|
||||
import json
|
||||
|
||||
from . import Terminal
|
||||
from .mongo import (
|
||||
|
|
@ -493,3 +494,14 @@ def timeit(method):
|
|||
print('%r %2.2f ms' % (method.__name__, (te - ts) * 1000))
|
||||
return result
|
||||
return timed
|
||||
|
||||
|
||||
def debug_log_instance(logger, msg, instance):
|
||||
"""Helper function to write instance.data as json"""
|
||||
def _default_json(value):
|
||||
return str(value)
|
||||
|
||||
logger.debug(msg)
|
||||
logger.debug(
|
||||
json.dumps(instance.data, indent=4, default=_default_json)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue