debug: "verbose" command line argument to log to stdout (#1587)
Some checks failed
Generate translation template / generate-pot (push) Failing after 1s
Build check / build (push) Has been cancelled

This commit is contained in:
Colin Kinloch 2025-06-02 00:38:21 +01:00 committed by GitHub
parent c8045f7f04
commit 162fdabb9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 0 deletions

View file

@ -3,6 +3,7 @@
#include "util/helpers/helpers.h" #include "util/helpers/helpers.h"
#include "config/CemuConfig.h" #include "config/CemuConfig.h"
#include "config/ActiveSettings.h" #include "config/ActiveSettings.h"
#include "config/LaunchSettings.h"
#include <mutex> #include <mutex>
#include <condition_variable> #include <condition_variable>
@ -144,6 +145,9 @@ bool cemuLog_log(LogType type, std::string_view text)
if (!cemuLog_isLoggingEnabled(type)) if (!cemuLog_isLoggingEnabled(type))
return false; return false;
if (LaunchSettings::Verbose())
std::cout << text << std::endl;
cemuLog_writeLineToLog(text); cemuLog_writeLineToLog(text);
const auto it = std::find_if(g_logging_window_mapping.cbegin(), g_logging_window_mapping.cend(), const auto it = std::find_if(g_logging_window_mapping.cbegin(), g_logging_window_mapping.cend(),

View file

@ -59,6 +59,9 @@ bool LaunchSettings::HandleCommandline(const std::vector<std::wstring>& args)
desc.add_options() desc.add_options()
("help,h", "This help screen") ("help,h", "This help screen")
("version,v", "Displays the version of Cemu") ("version,v", "Displays the version of Cemu")
#if !BOOST_OS_WINDOWS
("verbose", "Log to stdout")
#endif
("game,g", po::wvalue<std::wstring>(), "Path of game to launch") ("game,g", po::wvalue<std::wstring>(), "Path of game to launch")
("title-id,t", po::value<std::string>(), "Title ID of the title to be launched (overridden by --game)") ("title-id,t", po::value<std::string>(), "Title ID of the title to be launched (overridden by --game)")
@ -125,6 +128,9 @@ bool LaunchSettings::HandleCommandline(const std::vector<std::wstring>& args)
return false; // exit in main return false; // exit in main
} }
if (vm.count("verbose"))
s_verbose = true;
if (vm.count("game")) if (vm.count("game"))
{ {
std::wstring tmp = vm["game"].as<std::wstring>(); std::wstring tmp = vm["game"].as<std::wstring>();

View file

@ -22,6 +22,8 @@ public:
static std::optional<bool> RenderUpsideDownEnabled() { return s_render_upside_down; } static std::optional<bool> RenderUpsideDownEnabled() { return s_render_upside_down; }
static std::optional<bool> FullscreenEnabled() { return s_fullscreen; } static std::optional<bool> FullscreenEnabled() { return s_fullscreen; }
static bool Verbose() { return s_verbose; }
static bool GDBStubEnabled() { return s_enable_gdbstub; } static bool GDBStubEnabled() { return s_enable_gdbstub; }
static bool NSightModeEnabled() { return s_nsight_mode; } static bool NSightModeEnabled() { return s_nsight_mode; }
@ -40,6 +42,8 @@ private:
inline static std::optional<bool> s_render_upside_down{}; inline static std::optional<bool> s_render_upside_down{};
inline static std::optional<bool> s_fullscreen{}; inline static std::optional<bool> s_fullscreen{};
inline static bool s_verbose = false;
inline static bool s_enable_gdbstub = false; inline static bool s_enable_gdbstub = false;
inline static bool s_nsight_mode = false; inline static bool s_nsight_mode = false;