Skip to content

Commit 84aee39

Browse files
committed
"verbose" command line argument to log to stdout
1 parent c8045f7 commit 84aee39

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/Cemu/Logging/CemuLogging.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "util/helpers/helpers.h"
44
#include "config/CemuConfig.h"
55
#include "config/ActiveSettings.h"
6+
#include "config/LaunchSettings.h"
67

78
#include <mutex>
89
#include <condition_variable>
@@ -144,6 +145,9 @@ bool cemuLog_log(LogType type, std::string_view text)
144145
if (!cemuLog_isLoggingEnabled(type))
145146
return false;
146147

148+
if (LaunchSettings::Verbose())
149+
std::cout << text << std::endl;
150+
147151
cemuLog_writeLineToLog(text);
148152

149153
const auto it = std::find_if(g_logging_window_mapping.cbegin(), g_logging_window_mapping.cend(),

src/config/LaunchSettings.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ bool LaunchSettings::HandleCommandline(const std::vector<std::wstring>& args)
5959
desc.add_options()
6060
("help,h", "This help screen")
6161
("version,v", "Displays the version of Cemu")
62+
#if !BOOST_OS_WINDOWS
63+
("verbose", "Log to stdout")
64+
#endif
6265

6366
("game,g", po::wvalue<std::wstring>(), "Path of game to launch")
6467
("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)
125128
return false; // exit in main
126129
}
127130

131+
if (vm.count("verbose"))
132+
s_verbose = true;
133+
128134
if (vm.count("game"))
129135
{
130136
std::wstring tmp = vm["game"].as<std::wstring>();

src/config/LaunchSettings.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class LaunchSettings
2222
static std::optional<bool> RenderUpsideDownEnabled() { return s_render_upside_down; }
2323
static std::optional<bool> FullscreenEnabled() { return s_fullscreen; }
2424

25+
static bool Verbose() { return s_verbose; }
26+
2527
static bool GDBStubEnabled() { return s_enable_gdbstub; }
2628
static bool NSightModeEnabled() { return s_nsight_mode; }
2729

@@ -40,6 +42,8 @@ class LaunchSettings
4042

4143
inline static std::optional<bool> s_render_upside_down{};
4244
inline static std::optional<bool> s_fullscreen{};
45+
46+
inline static bool s_verbose = false;
4347

4448
inline static bool s_enable_gdbstub = false;
4549
inline static bool s_nsight_mode = false;

0 commit comments

Comments
 (0)