improvements in logging

This commit is contained in:
georgemoralis 2023-08-14 01:24:03 +03:00
parent 5a30f0711e
commit 6a5308d521
3 changed files with 28 additions and 17 deletions

View File

@ -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*/) {

View File

@ -1,21 +1,25 @@
#include <vector>
#include <spdlog/common.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/pattern_formatter.h>
#include <spdlog/sinks/basic_file_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>
#include <vector>
namespace logging {
std::vector<spdlog::sink_ptr> sinks;
std::vector<spdlog::sink_ptr> sinks;
int init(bool use_stdout) {
auto f = std::make_unique<spdlog::pattern_formatter>("%^|%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<spdlog::sinks::stdout_color_sink_mt>());
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<spdlog::sinks::stdout_color_sink_mt>());
sinks.push_back(std::make_shared<spdlog::sinks::basic_file_sink_mt>(L"shadps4.txt", true));
spdlog::set_default_logger(std::make_shared<spdlog::logger>("shadps4 logger", begin(sinks), end(sinks)));
auto f = std::make_unique<spdlog::pattern_formatter>("%^|%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
}
}
void set_level(spdlog::level::level_enum log_level) { spdlog::set_level(log_level); }
} // namespace logging

View File

@ -1,5 +1,7 @@
#pragma once
#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE
#include <spdlog/spdlog.h>
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