mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
OP-2958 - extended logging for profile filtering
Updated logging for collect_ftrack_famiy
This commit is contained in:
parent
d2533a6a1b
commit
fe38ff5e23
2 changed files with 23 additions and 12 deletions
|
|
@ -44,12 +44,6 @@ def _profile_exclusion(matching_profiles, logger):
|
|||
Returns:
|
||||
dict: Most matching profile.
|
||||
"""
|
||||
|
||||
logger.info(
|
||||
"Search for first most matching profile in match order:"
|
||||
" Host name -> Task name -> Family."
|
||||
)
|
||||
|
||||
if not matching_profiles:
|
||||
return None
|
||||
|
||||
|
|
@ -168,6 +162,15 @@ def filter_profiles(profiles_data, key_values, keys_order=None, logger=None):
|
|||
_keys_order.append(key)
|
||||
keys_order = tuple(_keys_order)
|
||||
|
||||
log_parts = " | ".join([
|
||||
"{}: \"{}\"".format(*item)
|
||||
for item in key_values.items()
|
||||
])
|
||||
|
||||
logger.info(
|
||||
"Looking for matching profile for: {}".format(log_parts)
|
||||
)
|
||||
|
||||
matching_profiles = None
|
||||
highest_profile_points = -1
|
||||
# Each profile get 1 point for each matching filter. Profile with most
|
||||
|
|
@ -205,11 +208,6 @@ def filter_profiles(profiles_data, key_values, keys_order=None, logger=None):
|
|||
if profile_points == highest_profile_points:
|
||||
matching_profiles.append((profile, profile_scores))
|
||||
|
||||
log_parts = " | ".join([
|
||||
"{}: \"{}\"".format(*item)
|
||||
for item in key_values.items()
|
||||
])
|
||||
|
||||
if not matching_profiles:
|
||||
logger.info(
|
||||
"None of profiles match your setup. {}".format(log_parts)
|
||||
|
|
@ -221,4 +219,9 @@ def filter_profiles(profiles_data, key_values, keys_order=None, logger=None):
|
|||
"More than one profile match your setup. {}".format(log_parts)
|
||||
)
|
||||
|
||||
return _profile_exclusion(matching_profiles, logger)
|
||||
profile = _profile_exclusion(matching_profiles, logger)
|
||||
if profile:
|
||||
logger.info(
|
||||
"Profile selected: {}".format(profile)
|
||||
)
|
||||
return profile
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ class CollectFtrackFamily(pyblish.api.InstancePlugin):
|
|||
self.log.warning("No profiles present for adding Ftrack family")
|
||||
return
|
||||
|
||||
add_ftrack_family = False
|
||||
task_name = instance.data.get("task",
|
||||
avalon.api.Session["AVALON_TASK"])
|
||||
host_name = avalon.api.Session["AVALON_APP"]
|
||||
|
|
@ -69,6 +70,13 @@ class CollectFtrackFamily(pyblish.api.InstancePlugin):
|
|||
else:
|
||||
instance.data["families"] = ["ftrack"]
|
||||
|
||||
result_str = "Adding"
|
||||
if not add_ftrack_family:
|
||||
result_str = "Not adding"
|
||||
self.log.info("{} 'ftrack' family for instance with '{}'".format(
|
||||
result_str, family
|
||||
))
|
||||
|
||||
def _get_add_ftrack_f_from_addit_filters(self,
|
||||
additional_filters,
|
||||
families,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue