2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-11-28 07:17: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

@@ -5,6 +5,7 @@
#include "Parsing/Simple/Matcher/SimpleMatcherFactory.h"
#include "Parsing/Simple/SimpleLexer.h"
#include "Parsing/Simple/SimpleParserValue.h"
#include "Utils/Logging/Log.h"
#include <format>
@@ -210,17 +211,17 @@ namespace graph2d
if (!parser.Parse())
{
std::cerr << std::format("Failed to parse {} \"{}\"\n", graphTypeName, graphName);
con::error("Failed to parse {} \"{}\"", graphTypeName, graphName);
return nullptr;
}
if (!parser.HasExpectedKnotCount())
{
std::cerr << std::format("Failed to load {} \"{}\": Actual knot count ({}) differs from expected ({})\n",
graphTypeName,
graphName,
parser.GetActualKnotCount(),
parser.GetExpectedKnotCount());
con::error("Failed to load {} \"{}\": Actual knot count ({}) differs from expected ({})",
graphTypeName,
graphName,
parser.GetActualKnotCount(),
parser.GetExpectedKnotCount());
return nullptr;
}

View File

@@ -8,6 +8,7 @@
#include "Parsing/Impl/ParserMultiInputStream.h"
#include "Parsing/Impl/ParserSingleInputStream.h"
#include "Parsing/Simple/SimpleLexer.h"
#include "Utils/Logging/Log.h"
using namespace menu;
@@ -65,25 +66,25 @@ bool MenuFileReader::IsValidEndState(const MenuFileParserState* state) const
{
if (state->m_current_item)
{
std::cerr << "In \"" << m_file_name << "\": Unclosed item at end of file!\n";
con::error("In \"{}\": Unclosed item at end of file!", m_file_name);
return false;
}
if (state->m_current_menu)
{
std::cerr << "In \"" << m_file_name << "\": Unclosed menu at end of file!\n";
con::error("In \"{}\": Unclosed menu at end of file!", m_file_name);
return false;
}
if (state->m_current_function)
{
std::cerr << "In \"" << m_file_name << "\": Unclosed function at end of file!\n";
con::error("In \"{}\": Unclosed function at end of file!", m_file_name);
return false;
}
if (state->m_in_global_scope)
{
std::cerr << "In \"" << m_file_name << "\": Did not close global scope!\n";
con::error("In \"{}\": Did not close global scope!", m_file_name);
return false;
}
@@ -125,11 +126,11 @@ std::unique_ptr<ParsingResult> MenuFileReader::ReadMenuFile()
if (!parser->Parse())
{
std::cerr << "Parsing menu file failed!\n";
con::error("Parsing menu file failed!");
const auto* parserEndState = parser->GetState();
if (parserEndState->m_current_event_handler_set && !parserEndState->m_permissive_mode)
std::cerr << "You can use the --menu-permissive option to try to compile the event handler script anyway.\n";
con::error("You can use the --menu-permissive option to try to compile the event handler script anyway.");
return nullptr;
}