2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-12-16 15:47:47 +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

@@ -1,5 +1,6 @@
#include "ZoneWriter.h"
#include "Utils/Logging/Log.h"
#include "WritingException.h"
#include "WritingFileStream.h"
@@ -73,12 +74,12 @@ bool ZoneWriter::WriteZone(std::ostream& stream)
}
catch (WritingException& e)
{
std::cout << std::format("Writing fastfile failed: {}\n", e.Message());
con::error("Writing fastfile failed: {}", e.Message());
return false;
}
catch (std::runtime_error& e)
{
std::cout << std::format("Writing fastfile failed: {}\n", e.what());
con::error("Writing fastfile failed: {}", e.what());
return false;
}

View File

@@ -1,5 +1,6 @@
#include "ZoneWriting.h"
#include "Utils/Logging/Log.h"
#include "Writing/IZoneWriterFactory.h"
#include <chrono>
@@ -15,7 +16,7 @@ bool ZoneWriting::WriteZone(std::ostream& stream, const Zone& zone)
const auto zoneWriter = factory->CreateWriter(zone);
if (zoneWriter == nullptr)
{
std::cerr << std::format("Could not create ZoneWriter for zone \"{}\".\n", zone.m_name);
con::error("Could not create ZoneWriter for zone \"{}\".", zone.m_name);
return false;
}
@@ -23,7 +24,7 @@ bool ZoneWriting::WriteZone(std::ostream& stream, const Zone& zone)
const auto end = std::chrono::high_resolution_clock::now();
std::cout << std::format("Writing zone \"{}\" took {} ms.\n", zone.m_name, std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count());
con::info("Writing zone \"{}\" took {} ms.", zone.m_name, std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count());
return result;
}