From 2099827554a740e2dc5538926b8e185191192907 Mon Sep 17 00:00:00 2001 From: Olivier Charvin Date: Mon, 18 Dec 2023 17:57:42 +0100 Subject: [PATCH] blocks2assets: debug filepath on reading unsupported blocks (#92885) When logging that there is no reader implemented for a certain data-block type, include the filepath of the blend file that contains that data-block. Reviewed-on: https://projects.blender.org/blender/blender-asset-tracer/pulls/92885 --- blender_asset_tracer/trace/blocks2assets.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/blender_asset_tracer/trace/blocks2assets.py b/blender_asset_tracer/trace/blocks2assets.py index 3dd43c9..be20258 100644 --- a/blender_asset_tracer/trace/blocks2assets.py +++ b/blender_asset_tracer/trace/blocks2assets.py @@ -44,9 +44,20 @@ def iter_assets(block: blendfile.BlendFileBlock) -> typing.Iterator[result.Block try: block_reader = _funcs_for_code[block.code] except KeyError: - if block.code not in _warned_about_types: - log.debug("No reader implemented for block type %r", block.code.decode()) - _warned_about_types.add(block.code) + if block.code in _warned_about_types: + return + + blocktype = block.code.decode() + filepath = block.get(b"filepath", "", as_str=True) + if filepath: + log.debug( + "No reader implemented for block type %r (filepath=%r)", + blocktype, + filepath, + ) + else: + log.debug("No reader implemented for block type %r", blocktype) + _warned_about_types.add(block.code) return log.debug("Tracing block %r", block)