use new log fmt wrappers

This commit is contained in:
TakaRikka
2026-08-05 00:43:23 -07:00
parent 027e23d2e7
commit 0ed984a863
4 changed files with 7 additions and 18 deletions
+2 -2
View File
@@ -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
+2 -2
View File
@@ -15,6 +15,7 @@
#include "../generator/utility/string.hpp"
#include <fstream>
#include <mods/svc/log.hpp>
#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<std::string> RandomizerContext::WriteToFile() {
@@ -154,7 +154,7 @@ std::optional<std::string> 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;
}
-12
View File
@@ -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);
}
}
+3 -2
View File
@@ -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 <mods/svc/log.hpp>
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;
}
}