mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-01 23:35:55 +00:00
Improve verbose log suppression
This commit is contained in:
parent
0c828cbb37
commit
ecddada150
49
app/main.cpp
49
app/main.cpp
@ -162,6 +162,9 @@ void qtLogToDiskHandler(QtMsgType type, const QMessageLogContext&, const QString
|
|||||||
typeTxt = "Info";
|
typeTxt = "Info";
|
||||||
break;
|
break;
|
||||||
case QtWarningMsg:
|
case QtWarningMsg:
|
||||||
|
if (s_SuppressVerboseOutput) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
typeTxt = "Warning";
|
typeTxt = "Warning";
|
||||||
break;
|
break;
|
||||||
case QtCriticalMsg:
|
case QtCriticalMsg:
|
||||||
@ -405,18 +408,6 @@ int main(int argc, char *argv[])
|
|||||||
// Register custom metatypes for use in signals
|
// Register custom metatypes for use in signals
|
||||||
qRegisterMetaType<NvApp>("NvApp");
|
qRegisterMetaType<NvApp>("NvApp");
|
||||||
|
|
||||||
SDL_version compileVersion;
|
|
||||||
SDL_VERSION(&compileVersion);
|
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
|
||||||
"Compiled with SDL %d.%d.%d",
|
|
||||||
compileVersion.major, compileVersion.minor, compileVersion.patch);
|
|
||||||
|
|
||||||
SDL_version runtimeVersion;
|
|
||||||
SDL_GetVersion(&runtimeVersion);
|
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
|
||||||
"Running with SDL %d.%d.%d",
|
|
||||||
runtimeVersion.major, runtimeVersion.minor, runtimeVersion.patch);
|
|
||||||
|
|
||||||
// Allow the display to sleep by default. We will manually use SDL_DisableScreenSaver()
|
// Allow the display to sleep by default. We will manually use SDL_DisableScreenSaver()
|
||||||
// and SDL_EnableScreenSaver() when appropriate. This hint must be set before
|
// and SDL_EnableScreenSaver() when appropriate. This hint must be set before
|
||||||
// initializing the SDL video subsystem to have any effect.
|
// initializing the SDL video subsystem to have any effect.
|
||||||
@ -494,6 +485,31 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
|
GlobalCommandLineParser parser;
|
||||||
|
GlobalCommandLineParser::ParseResult commandLineParserResult = parser.parse(app.arguments());
|
||||||
|
switch (commandLineParserResult) {
|
||||||
|
case GlobalCommandLineParser::ListRequested:
|
||||||
|
#ifdef USE_CUSTOM_LOGGER
|
||||||
|
// Don't log to the console since it will jumble the command output
|
||||||
|
s_SuppressVerboseOutput = true;
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
SDL_version compileVersion;
|
||||||
|
SDL_VERSION(&compileVersion);
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Compiled with SDL %d.%d.%d",
|
||||||
|
compileVersion.major, compileVersion.minor, compileVersion.patch);
|
||||||
|
|
||||||
|
SDL_version runtimeVersion;
|
||||||
|
SDL_GetVersion(&runtimeVersion);
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Running with SDL %d.%d.%d",
|
||||||
|
runtimeVersion.major, runtimeVersion.minor, runtimeVersion.patch);
|
||||||
|
|
||||||
// Apply the initial translation based on user preference
|
// Apply the initial translation based on user preference
|
||||||
StreamingPreferences prefs;
|
StreamingPreferences prefs;
|
||||||
prefs.retranslate();
|
prefs.retranslate();
|
||||||
@ -609,8 +625,7 @@ int main(int argc, char *argv[])
|
|||||||
QString initialView;
|
QString initialView;
|
||||||
bool hasGUI = true;
|
bool hasGUI = true;
|
||||||
|
|
||||||
GlobalCommandLineParser parser;
|
switch (commandLineParserResult) {
|
||||||
switch (parser.parse(app.arguments())) {
|
|
||||||
case GlobalCommandLineParser::NormalStartRequested:
|
case GlobalCommandLineParser::NormalStartRequested:
|
||||||
initialView = "qrc:/gui/PcView.qml";
|
initialView = "qrc:/gui/PcView.qml";
|
||||||
break;
|
break;
|
||||||
@ -651,12 +666,6 @@ int main(int argc, char *argv[])
|
|||||||
auto launcher = new CliListApps::Launcher(listParser.getHost(), listParser, &app);
|
auto launcher = new CliListApps::Launcher(listParser.getHost(), listParser, &app);
|
||||||
launcher->execute(new ComputerManager(&app));
|
launcher->execute(new ComputerManager(&app));
|
||||||
hasGUI = false;
|
hasGUI = false;
|
||||||
|
|
||||||
#ifdef USE_CUSTOM_LOGGER
|
|
||||||
// Don't log to the console since it will jumble the command output
|
|
||||||
s_SuppressVerboseOutput = true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user