From 6a5308d521fc40408d147ab37a6ab6859ebf6b2c Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Mon, 14 Aug 2023 01:24:03 +0300 Subject: [PATCH] improvements in logging --- src/Core/PS4/HLE/LibSceVideoOut.cpp | 12 ++++++++---- src/Util/log.cpp | 30 ++++++++++++++++------------- src/Util/log.h | 3 +++ 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/Core/PS4/HLE/LibSceVideoOut.cpp b/src/Core/PS4/HLE/LibSceVideoOut.cpp index 53a42840..ca2f6a9c 100644 --- a/src/Core/PS4/HLE/LibSceVideoOut.cpp +++ b/src/Core/PS4/HLE/LibSceVideoOut.cpp @@ -12,17 +12,20 @@ namespace HLE::Libs::LibSceVideoOut { int32_t PS4_SYSV_ABI sceVideoOutGetFlipStatus(int32_t handle /*, SceVideoOutFlipStatus* status*/) { - BREAKPOINT(); + //BREAKPOINT(); + PRINT_DUMMY_FUNCTION_NAME(); return 0; } int32_t PS4_SYSV_ABI sceVideoOutSubmitFlip(int32_t handle, int32_t bufferIndex, int32_t flipMode, int64_t flipArg) { - BREAKPOINT(); + //BREAKPOINT(); + PRINT_DUMMY_FUNCTION_NAME(); return 0; } int32_t PS4_SYSV_ABI sceVideoOutRegisterBuffers(int32_t handle, int32_t startIndex, void* const* addresses, int32_t bufferNum /*, const SceVideoOutBufferAttribute* attribute*/) { - BREAKPOINT(); + //BREAKPOINT(); + PRINT_DUMMY_FUNCTION_NAME(); return 0; } int32_t PS4_SYSV_ABI sceVideoOutAddFlipEvent(/*SceKernelEqueue eq,*/ int32_t handle, void* udata) { @@ -31,7 +34,8 @@ int32_t PS4_SYSV_ABI sceVideoOutAddFlipEvent(/*SceKernelEqueue eq,*/ int32_t han return 0; } int32_t PS4_SYSV_ABI sceVideoOutSetFlipRate(int32_t handle, int32_t rate) { - BREAKPOINT(); + //BREAKPOINT(); + PRINT_DUMMY_FUNCTION_NAME(); return 0; } int32_t PS4_SYSV_ABI sceVideoOutGetResolutionStatus(int32_t handle /*, SceVideoOutResolutionStatus* status*/) { diff --git a/src/Util/log.cpp b/src/Util/log.cpp index 18c85f15..935a7d8c 100644 --- a/src/Util/log.cpp +++ b/src/Util/log.cpp @@ -1,21 +1,25 @@ -#include #include -#include #include +#include +#include #include - +#include namespace logging { - std::vector sinks; +std::vector sinks; - int init(bool use_stdout) { - auto f = std::make_unique("%^|%L|: %v%$", spdlog::pattern_time_type::local, std::string("")); // disable eol - spdlog::set_formatter(std::move(f)); - sinks.clear();//clear existing sinks - if (use_stdout)//if we use stdout window then init it as well - sinks.push_back(std::make_shared()); +int init(bool use_stdout) { + sinks.clear(); // clear existing sinks + if (use_stdout) // if we use stdout window then init it as well + sinks.push_back(std::make_shared()); + sinks.push_back(std::make_shared(L"shadps4.txt", true)); + spdlog::set_default_logger(std::make_shared("shadps4 logger", begin(sinks), end(sinks))); + auto f = std::make_unique("%^|%L|: %v%$", spdlog::pattern_time_type::local, std::string("")); // disable eol + spdlog::set_formatter(std::move(f)); + return 0; // all ok +} - return 0;//all ok - } -} \ No newline at end of file +void set_level(spdlog::level::level_enum log_level) { spdlog::set_level(log_level); } + +} // namespace logging \ No newline at end of file diff --git a/src/Util/log.h b/src/Util/log.h index d825a324..350d8dc3 100644 --- a/src/Util/log.h +++ b/src/Util/log.h @@ -1,5 +1,7 @@ #pragma once +#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE + #include namespace logging { @@ -25,6 +27,7 @@ namespace logging { if (flag) LOG_CRITICAL(__VA_ARGS__) int init(bool use_stdout); +void set_level(spdlog::level::level_enum log_level); } // namespace logging // copyright vita3k emu https://github.com/Vita3K/Vita3K/blob/master/vita3k/util/include/util/log.h