mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-02-14 19:33:02 +00:00
chore: update all logging to use centralized logging component
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "Image/IwiWriter27.h"
|
||||
#include "ObjContainer/IPak/IPak.h"
|
||||
#include "ObjWriting.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@@ -58,7 +59,7 @@ namespace
|
||||
const auto filePathImage = searchPath.Open(imageFileName);
|
||||
if (!filePathImage.IsOpen())
|
||||
{
|
||||
std::cerr << std::format("Could not find data for image \"{}\"\n", image.name);
|
||||
con::error("Could not find data for image \"{}\"", image.name);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "Dumping/Localize/StringFileDumper.h"
|
||||
#include "Localize/LocalizeCommon.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <format>
|
||||
#include <iostream>
|
||||
@@ -38,7 +39,7 @@ namespace localize
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << std::format("Could not create string file for dumping localized strings of zone '{}'\n", context.m_zone.m_name);
|
||||
con::error("Could not create string file for dumping localized strings of zone '{}'", context.m_zone.m_name);
|
||||
}
|
||||
}
|
||||
} // namespace localize
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "RawFileDumperT6.h"
|
||||
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <zlib.h>
|
||||
#include <zutil.h>
|
||||
@@ -18,7 +20,7 @@ namespace
|
||||
|
||||
if (rawFile->len <= 4)
|
||||
{
|
||||
std::cerr << "Invalid len of animtree file \"" << rawFile->name << "\"\n";
|
||||
con::error("Invalid len of animtree file \"{}\"", rawFile->name);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -27,7 +29,7 @@ namespace
|
||||
|
||||
if (outLen > ANIMTREE_MAX_SIZE)
|
||||
{
|
||||
std::cerr << "Invalid size of animtree file \"" << rawFile->name << "\": " << outLen << "\n";
|
||||
con::error("Invalid size of animtree file \"{}\": {}", rawFile->name, outLen);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -59,7 +61,7 @@ namespace
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cerr << "Inflate failed for dumping animtree file \"" << rawFile->name << "\"\n";
|
||||
con::error("Inflate failed for dumping animtree file \"{}\"", rawFile->name);
|
||||
inflateEnd(&zs);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "Game/T6/SoundConstantsT6.h"
|
||||
#include "ObjContainer/SoundBank/SoundBank.h"
|
||||
#include "Sound/WavWriter.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "Zone/ZoneRegistry.h"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -670,7 +671,7 @@ namespace
|
||||
const auto outFile = OpenAssetOutputFile(context, assetFileName, ".wav");
|
||||
if (!outFile)
|
||||
{
|
||||
std::cerr << std::format("Failed to open sound output file: \"{}\"\n", assetFileName);
|
||||
con::error("Failed to open sound output file: \"{}\"", assetFileName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -700,7 +701,7 @@ namespace
|
||||
const auto outFile = OpenAssetOutputFile(context, assetFileName, extension);
|
||||
if (!outFile)
|
||||
{
|
||||
std::cerr << std::format("Failed to open sound output file: \"{}\"\n", assetFileName);
|
||||
con::error("Failed to open sound output file: \"{}\"", assetFileName);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -737,19 +738,19 @@ namespace
|
||||
case SND_ASSET_FORMAT_WMA:
|
||||
case SND_ASSET_FORMAT_WIIUADPCM:
|
||||
case SND_ASSET_FORMAT_MPC:
|
||||
std::cerr << std::format("Cannot dump sound (Unknown sound format {}): \"{}\"\n", static_cast<unsigned>(format), alias.assetFileName);
|
||||
con::error("Cannot dump sound (Unknown sound format {}): \"{}\"", static_cast<unsigned>(format), alias.assetFileName);
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
std::cerr << std::format("Cannot dump sound (Unknown sound format {}): \"{}\"\n", static_cast<unsigned>(format), alias.assetFileName);
|
||||
con::error("Cannot dump sound (Unknown sound format {}): \"{}\"", static_cast<unsigned>(format), alias.assetFileName);
|
||||
break;
|
||||
}
|
||||
|
||||
return format;
|
||||
}
|
||||
|
||||
std::cerr << std::format("Could not find data for sound \"{}\"\n", alias.assetFileName);
|
||||
con::warn("Could not find data for sound \"{}\"", alias.assetFileName);
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -760,7 +761,7 @@ namespace
|
||||
const auto outFile = OpenAssetOutputFile(context, std::format("soundbank/{}.aliases", sndBank.name), ".csv");
|
||||
if (!outFile)
|
||||
{
|
||||
std::cerr << std::format("Failed to open sound alias output file: \"\"\n", sndBank.name);
|
||||
con::error("Failed to open sound alias output file: \"\"", sndBank.name);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -804,7 +805,7 @@ namespace
|
||||
const auto outFile = OpenAssetOutputFile(context, std::format("soundbank/{}.reverbs", sndBank.name), ".csv");
|
||||
if (!outFile)
|
||||
{
|
||||
std::cerr << std::format("Failed to open sound reverb output file: \"{}\"\n", sndBank.name);
|
||||
con::error("Failed to open sound reverb output file: \"{}\"", sndBank.name);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -843,7 +844,7 @@ namespace
|
||||
const auto outFile = OpenAssetOutputFile(context, std::format("soundbank/{}.ducklist", sndBank.name), ".csv");
|
||||
if (!outFile)
|
||||
{
|
||||
std::cerr << std::format("Failed to open sound reverb output file: \"{}\"\n", sndBank.name);
|
||||
con::error("Failed to open sound reverb output file: \"{}\"", sndBank.name);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -860,7 +861,7 @@ namespace
|
||||
const auto duckFile = OpenAssetOutputFile(context, std::format("soundbank/ducks/{}", duck.name), ".duk");
|
||||
if (!outFile)
|
||||
{
|
||||
std::cerr << std::format("Failed to open sound duck output file: \"{}\"\n", duck.name);
|
||||
con::error("Failed to open sound duck output file: \"{}\"", duck.name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "Csv/CsvStream.h"
|
||||
#include "ObjContainer/SoundBank/SoundBank.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
|
||||
#include <format>
|
||||
|
||||
@@ -123,7 +124,7 @@ namespace
|
||||
{
|
||||
auto outputFile = this->m_context.OpenAssetFile(filename);
|
||||
if (outputFile == nullptr)
|
||||
std::cerr << std::format("Failed to open sound driver globals output file for: \"{}\"\n", filename);
|
||||
con::error("Failed to open sound driver globals output file for: \"{}\"", filename);
|
||||
|
||||
return outputFile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user