mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-04-21 10:58:44 +00:00
chore: update all logging to use centralized logging component
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "GltfBinInput.h"
|
||||
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "XModel/Gltf/GltfConstants.h"
|
||||
|
||||
#include <exception>
|
||||
@@ -41,7 +42,7 @@ bool BinInput::ReadGltfData(std::istream& stream)
|
||||
|
||||
if (magic != GLTF_MAGIC)
|
||||
{
|
||||
std::cerr << "Invalid magic when trying to read GLB\n";
|
||||
con::error("Invalid magic when trying to read GLB");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -51,7 +52,7 @@ bool BinInput::ReadGltfData(std::istream& stream)
|
||||
|
||||
if (version != GLTF_VERSION)
|
||||
{
|
||||
std::cerr << std::format("Unsupported version {} when trying to read GLB: Expected version {}\n", version, GLTF_VERSION);
|
||||
con::error("Unsupported version {} when trying to read GLB: Expected version {}", version, GLTF_VERSION);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -82,7 +83,7 @@ bool BinInput::ReadGltfData(std::istream& stream)
|
||||
}
|
||||
catch (const nlohmann::json::exception& e)
|
||||
{
|
||||
std::cerr << std::format("Failed trying to parse JSON of GLB: {}\n", e.what());
|
||||
con::error("Failed trying to parse JSON of GLB: {}", e.what());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -103,7 +104,7 @@ bool BinInput::ReadGltfData(std::istream& stream)
|
||||
|
||||
if (!m_json)
|
||||
{
|
||||
std::cerr << "Failed to load GLB due to missing JSON\n";
|
||||
con::error("Failed to load GLB due to missing JSON");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -116,7 +117,7 @@ bool BinInput::Read(std::istream& stream, void* dest, const size_t dataSize, con
|
||||
if (stream.gcount() != dataSize)
|
||||
{
|
||||
if (errorWhenFailed)
|
||||
std::cerr << std::format("Unexpected EOF while reading GLB {}\n", readTypeName);
|
||||
con::error("Unexpected EOF while reading GLB {}", readTypeName);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "Internal/GltfAccessor.h"
|
||||
#include "Internal/GltfBuffer.h"
|
||||
#include "Internal/GltfBufferView.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#pragma warning(push, 0)
|
||||
#include <Eigen>
|
||||
@@ -798,7 +799,7 @@ namespace
|
||||
}
|
||||
catch (const nlohmann::json::exception& e)
|
||||
{
|
||||
std::cerr << std::format("Failed to parse GLTF JSON: {}\n", e.what());
|
||||
con::error("Failed to parse GLTF JSON: {}", e.what());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -818,7 +819,7 @@ namespace
|
||||
}
|
||||
catch (const GltfLoadException& e)
|
||||
{
|
||||
std::cerr << std::format("Failed to load GLTF: {}\n", e.Str());
|
||||
con::error("Failed to load GLTF: {}", e.Str());
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "GltfTextInput.h"
|
||||
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <exception>
|
||||
#include <format>
|
||||
#include <iostream>
|
||||
@@ -41,7 +43,7 @@ bool TextInput::ReadGltfData(std::istream& stream)
|
||||
}
|
||||
catch (nlohmann::json::exception& e)
|
||||
{
|
||||
std::cerr << std::format("Failed to parse json of GLTF: {}", e.what());
|
||||
con::error("Failed to parse json of GLTF: {}", e.what());
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user