Add more contextual log printing on missing object/asset reference

#2414
This commit is contained in:
Wojtek Figat
2024-09-15 23:03:53 +02:00
parent 1fa0159079
commit a367d40913
6 changed files with 74 additions and 15 deletions

View File

@@ -881,7 +881,8 @@ ScriptingObject* Scripting::FindObject(Guid id, const MClass* type)
// Check type
if (!type || result->Is(type))
return result;
LOG(Warning, "Found scripting object with ID={0} of type {1} that doesn't match type {2}. {3}", id, String(result->GetType().Fullname), String(type->GetFullName()), LogContext::GetInfo());
LOG(Warning, "Found scripting object with ID={0} of type {1} that doesn't match type {2}", id, String(result->GetType().Fullname), String(type->GetFullName()));
LogContext::Print(LogType::Warning);
return nullptr;
}
@@ -900,7 +901,8 @@ ScriptingObject* Scripting::FindObject(Guid id, const MClass* type)
return asset;
}
LOG(Warning, "Unable to find scripting object with ID={0}. Required type {1}. {2}", id, String(type->GetFullName()), LogContext::GetInfo());
LOG(Warning, "Unable to find scripting object with ID={0}. Required type {1}", id, String(type->GetFullName()));
LogContext::Print(LogType::Warning);
return nullptr;
}