Skip to content

Commit 324e6c6

Browse files
committed
"verbose" command line argument to log to stdout
1 parent 6df3e17 commit 324e6c6

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ 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+
("verbose", "Log to stdout")
6263

6364
("game,g", po::wvalue<std::wstring>(), "Path of game to launch")
6465
("title-id,t", po::value<std::string>(), "Title ID of the title to be launched (overridden by --game)")
@@ -125,6 +126,9 @@ bool LaunchSettings::HandleCommandline(const std::vector<std::wstring>& args)
125126
return false; // exit in main
126127
}
127128

129+
if (vm.count("verbose"))
130+
s_verbose = true;
131+
128132
if (vm.count("game"))
129133
{
130134
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)