From 0ed984a86360fd9d99bb0e8160d16403cf914078 Mon Sep 17 00:00:00 2001 From: TakaRikka Date: Wed, 5 Aug 2026 00:43:23 -0700 Subject: [PATCH] use new log fmt wrappers --- mods/randomizer/CMakeLists.txt | 4 ++-- mods/randomizer/src/randomizer_context.cpp | 4 ++-- mods/randomizer/src/session.hpp | 12 ------------ mods/randomizer/src/tools.cpp | 5 +++-- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/mods/randomizer/CMakeLists.txt b/mods/randomizer/CMakeLists.txt index eeecd5b1f7..e91e45a3f1 100644 --- a/mods/randomizer/CMakeLists.txt +++ b/mods/randomizer/CMakeLists.txt @@ -105,13 +105,13 @@ foreach (RANDOMIZER_FILE IN LISTS RANDOMIZER_DATA) endforeach () add_mod(randomizer - FEATURES game + FEATURES game fmt SOURCES src/mod.cpp ${RANDOMIZER_GENERATOR_SOURCES} ${RANDOMIZER_SOURCES} MOD_JSON mod.json RES_DIR res ) -target_link_libraries(randomizer PRIVATE yaml-cpp::yaml-cpp base64pp fmt::fmt randomizer_embeds) +target_link_libraries(randomizer PRIVATE yaml-cpp::yaml-cpp base64pp randomizer_embeds) string(LENGTH "${CMAKE_CURRENT_SOURCE_DIR}/" RANDOMIZER_SOURCE_PATH_SIZE) target_compile_definitions(randomizer PRIVATE diff --git a/mods/randomizer/src/randomizer_context.cpp b/mods/randomizer/src/randomizer_context.cpp index 1c34958465..1f75849277 100644 --- a/mods/randomizer/src/randomizer_context.cpp +++ b/mods/randomizer/src/randomizer_context.cpp @@ -15,6 +15,7 @@ #include "../generator/utility/string.hpp" #include +#include #include "custom_flow_ids.hpp" #include "d/actor/d_a_alink.h" @@ -24,7 +25,6 @@ #include "d/d_meter2_info.h" #include "d/d_msg_class.h" #include "d/d_msg_flow.h" -#include "fmt/format.h" #include "m_Do/m_Do_audio.h" std::optional RandomizerContext::WriteToFile() { @@ -154,7 +154,7 @@ std::optional RandomizerContext::LoadFromHash(const std::string& ha this->mHash = hash; if (!std::filesystem::exists(this->GetSeedDataPath())) { - randomizer::session::LogError(fmt::format("Failed to load Hash: {}", hash).c_str()); + mods::log::error("Failed to load Hash: {}", hash); mHash.clear(); return std::nullopt; } diff --git a/mods/randomizer/src/session.hpp b/mods/randomizer/src/session.hpp index c19e21229a..fdf295c779 100644 --- a/mods/randomizer/src/session.hpp +++ b/mods/randomizer/src/session.hpp @@ -25,16 +25,4 @@ struct ServiceManager { extern ServiceManager svc_mng; ModResult initialize(const ServiceManager& services); - -inline void LogError(const char* msg) { - svc_mng.log->error(svc_mng.mod_ctx, msg); -} - -inline void LogDebug(const char* msg) { - svc_mng.log->debug(svc_mng.mod_ctx, msg); -} - -inline void LogWarn(const char* msg) { - svc_mng.log->warn(svc_mng.mod_ctx, msg); -} } \ No newline at end of file diff --git a/mods/randomizer/src/tools.cpp b/mods/randomizer/src/tools.cpp index 1236aae7e8..f9e794222b 100644 --- a/mods/randomizer/src/tools.cpp +++ b/mods/randomizer/src/tools.cpp @@ -6,7 +6,6 @@ #include "d/d_item.h" #include "d/d_item_data.h" #include "f_op/f_op_actor_mng.h" -#include "fmt/format.h" #include "item_ids.h" #include "randomizer_context.hpp" #include "session.hpp" @@ -14,6 +13,8 @@ #include "utilities.h" #include "verify_item_functions.h" +#include + bool playerIsInRoomStage(s32 room, const char* stage) { // Only check room if it is valid @@ -713,7 +714,7 @@ int getStageSaveId(int id) { case 42: // F_SP102 (Title Screen / King Bulblin 1) return 0xFF; default: - randomizer::session::LogWarn(fmt::format("Failed to find Save Id for ID: {}" , id).c_str()); + mods::log::warn("Failed to find Save Id for ID: {}" , id); return -1; } }