mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-05-02 08:29:36 +00:00
Merge pull request #759 from michaeloliverx/asset-source-log
feat: add asset source description to loading logs
This commit is contained in:
@@ -5,6 +5,19 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <format>
|
#include <format>
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
std::string GetAssetSourceDescription(const Zone& targetZone, const XAssetInfoGeneric& assetInfo)
|
||||||
|
{
|
||||||
|
assert(assetInfo.m_zone != nullptr);
|
||||||
|
|
||||||
|
if (assetInfo.m_zone == &targetZone)
|
||||||
|
return "(src: disk)";
|
||||||
|
|
||||||
|
return std::format("(src: {})", assetInfo.m_zone->m_name);
|
||||||
|
}
|
||||||
|
} // namespace
|
||||||
|
|
||||||
IgnoredAssetLookup::IgnoredAssetLookup() = default;
|
IgnoredAssetLookup::IgnoredAssetLookup() = default;
|
||||||
|
|
||||||
IgnoredAssetLookup::IgnoredAssetLookup(const AssetList& assetList)
|
IgnoredAssetLookup::IgnoredAssetLookup(const AssetList& assetList)
|
||||||
@@ -152,8 +165,9 @@ XAssetInfoGeneric* AssetCreationContext::LoadDependencyGeneric(const asset_type_
|
|||||||
{
|
{
|
||||||
if (!result.HasFailed())
|
if (!result.HasFailed())
|
||||||
{
|
{
|
||||||
con::info(R"(Loaded {} "{}")", assetTypeName, assetName);
|
auto* assetInfo = result.GetAssetInfo();
|
||||||
return result.GetAssetInfo();
|
con::info(R"(Loaded {} "{}" {})", assetTypeName, assetName, GetAssetSourceDescription(m_zone, *assetInfo));
|
||||||
|
return assetInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
con::error(R"(Could not load asset "{}" of type "{}")", assetName, assetTypeName);
|
con::error(R"(Could not load asset "{}" of type "{}")", assetName, assetTypeName);
|
||||||
@@ -207,7 +221,8 @@ IndirectAssetReference AssetCreationContext::LoadIndirectAssetReferenceGeneric(c
|
|||||||
const auto result = m_creators->CreateAsset(assetType, assetName, *this);
|
const auto result = m_creators->CreateAsset(assetType, assetName, *this);
|
||||||
if (result.HasTakenAction() && !result.HasFailed())
|
if (result.HasTakenAction() && !result.HasFailed())
|
||||||
{
|
{
|
||||||
con::info(R"(Loaded {} "{}")", assetTypeName, assetName);
|
auto* assetInfo = result.GetAssetInfo();
|
||||||
|
con::info(R"(Loaded {} "{}" {})", assetTypeName, assetName, GetAssetSourceDescription(m_zone, *assetInfo));
|
||||||
}
|
}
|
||||||
else if (!result.HasTakenAction() && !result.HasFailed())
|
else if (!result.HasTakenAction() && !result.HasFailed())
|
||||||
{
|
{
|
||||||
@@ -249,8 +264,9 @@ XAssetInfoGeneric* AssetCreationContext::ForceLoadDependencyGeneric(const asset_
|
|||||||
{
|
{
|
||||||
if (!result.HasFailed())
|
if (!result.HasFailed())
|
||||||
{
|
{
|
||||||
con::info(R"(Loaded {} "{}")", assetTypeName, assetName);
|
auto* assetInfo = result.GetAssetInfo();
|
||||||
return result.GetAssetInfo();
|
con::info(R"(Loaded {} "{}" {})", assetTypeName, assetName, GetAssetSourceDescription(m_zone, *assetInfo));
|
||||||
|
return assetInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
con::error(R"(Could not load asset "{}" of type "{}")", assetName, assetTypeName);
|
con::error(R"(Could not load asset "{}" of type "{}")", assetName, assetTypeName);
|
||||||
|
|||||||
Reference in New Issue
Block a user