2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-23 16:56:39 +00:00

chore: update all logging to use centralized logging component

This commit is contained in:
Jan Laupetin
2025-09-10 19:52:42 +02:00
parent 1bf4033f41
commit 02f20f09b6
161 changed files with 824 additions and 664 deletions

View File

@@ -23,6 +23,7 @@
#include "Loading/Steps/StepVerifyMagic.h"
#include "Loading/Steps/StepVerifySignature.h"
#include "Utils/ClassUtils.h"
#include "Utils/Logging/Log.h"
#include <cassert>
#include <cstring>
@@ -100,7 +101,7 @@ namespace
if (!rsa->SetKey(ZoneConstants::RSA_PUBLIC_KEY_INFINITY_WARD, sizeof(ZoneConstants::RSA_PUBLIC_KEY_INFINITY_WARD)))
{
std::cerr << "Invalid public key for signature checking\n";
con::error("Invalid public key for signature checking");
return nullptr;
}

View File

@@ -22,6 +22,7 @@
#include "Loading/Steps/StepVerifyMagic.h"
#include "Loading/Steps/StepVerifySignature.h"
#include "Utils/ClassUtils.h"
#include "Utils/Logging/Log.h"
#include <cassert>
#include <cstring>
@@ -84,7 +85,7 @@ namespace
if (!rsa->SetKey(ZoneConstants::RSA_PUBLIC_KEY_INFINITY_WARD, sizeof(ZoneConstants::RSA_PUBLIC_KEY_INFINITY_WARD)))
{
std::cerr << "Invalid public key for signature checking\n";
con::error("Invalid public key for signature checking");
return nullptr;
}

View File

@@ -18,6 +18,7 @@
#include "Loading/Steps/StepVerifyMagic.h"
#include "Loading/Steps/StepVerifySignature.h"
#include "Utils/Endianness.h"
#include "Utils/Logging/Log.h"
#include "Zone/XChunk/XChunkProcessorInflate.h"
#include "Zone/XChunk/XChunkProcessorLzxDecompress.h"
#include "Zone/XChunk/XChunkProcessorSalsa20Decryption.h"
@@ -136,7 +137,7 @@ namespace
if (!rsa->SetKey(ZoneConstants::RSA_PUBLIC_KEY_TREYARCH, sizeof(ZoneConstants::RSA_PUBLIC_KEY_TREYARCH)))
{
std::cerr << "Invalid public key for signature checking\n";
con::error("Invalid public key for signature checking");
return nullptr;
}
@@ -269,7 +270,7 @@ std::unique_ptr<ZoneLoader> ZoneLoaderFactory::CreateLoaderForHeader(ZoneHeader&
fs::path dumpFileNamePath = fs::path(fileName).filename();
dumpFileNamePath.replace_extension(".dat");
std::string dumpFileName = dumpFileNamePath.string();
std::cerr << std::format("Dumping xbox assets is not supported, making a full fastfile data dump to {}\n", dumpFileName);
con::warn("Dumping xbox assets is not supported, making a full fastfile data dump to {}", dumpFileName);
zoneLoader->AddLoadingStep(step::CreateStepDumpData(dumpFileName, 0xFFFFFFFF));
}

View File

@@ -2,6 +2,7 @@
#include "Exception/LoadingException.h"
#include "LoadingFileStream.h"
#include "Utils/Logging/Log.h"
#include <algorithm>
#include <cassert>
@@ -87,7 +88,7 @@ std::unique_ptr<Zone> ZoneLoader::LoadZone(std::istream& stream)
}
catch (LoadingException& e)
{
std::cerr << std::format("Loading fastfile failed: {}\n", e.DetailedMessage());
con::error("Loading fastfile failed: {}", e.DetailedMessage());
return nullptr;
}

View File

@@ -5,6 +5,7 @@
#include "Loading/Exception/InvalidOffsetBlockOffsetException.h"
#include "Loading/Exception/OutOfBlockBoundsException.h"
#include "Utils/Alignment.h"
#include "Utils/Logging/Log.h"
#include <cassert>
#include <cstring>
@@ -414,8 +415,7 @@ namespace
ss << " " << m_block_offsets[block->m_index];
}
ss << "\n";
std::cout << ss.str();
con::debug(ss.str());
}
#endif

View File

@@ -2,6 +2,7 @@
#include "Loading/IZoneLoaderFactory.h"
#include "Loading/ZoneLoader.h"
#include "Utils/Logging/Log.h"
#include "Utils/ObjFileStream.h"
#include <filesystem>
@@ -18,7 +19,7 @@ std::unique_ptr<Zone> ZoneLoading::LoadZone(const std::string& path)
if (!file.is_open())
{
std::cerr << std::format("Could not open file '{}'.\n", path);
con::error("Could not open file '{}'.", path);
return nullptr;
}
@@ -26,7 +27,7 @@ std::unique_ptr<Zone> ZoneLoading::LoadZone(const std::string& path)
file.read(reinterpret_cast<char*>(&header), sizeof(header));
if (file.gcount() != sizeof(header))
{
std::cerr << std::format("Failed to read zone header from file '{}'.\n", path);
con::error("Failed to read zone header from file '{}'.", path);
return nullptr;
}
@@ -42,7 +43,7 @@ std::unique_ptr<Zone> ZoneLoading::LoadZone(const std::string& path)
if (!zoneLoader)
{
std::cerr << std::format("Could not create factory for zone '{}'.\n", zoneName);
con::error("Could not create factory for zone '{}'.", zoneName);
return nullptr;
}