Define qtlogging.ini location

This commit is contained in:
ZeldaZach 2025-02-02 13:34:45 -05:00
parent f0adafb275
commit 7b311ddeec
No known key found for this signature in database

View file

@ -177,8 +177,21 @@ int main(int argc, char *argv[])
SetUnhandledExceptionFilter(CockatriceUnhandledExceptionFilter); SetUnhandledExceptionFilter(CockatriceUnhandledExceptionFilter);
#endif #endif
#ifdef Q_OS_APPLE
// <build>/cockatrice/cockatrice.app/Contents/MacOS/cockatrice
const QString configPath = "../../../qtlogging.ini";
#elif defined(Q_OS_UNIX)
// <build>/cockatrice/cockatrice
const QString configPath = "./qtlogging.ini";
#elif defined(Q_OS_WIN)
// <build>/cockatrice/Debug/cockatrice.exe
const QString configPath = "../qtlogging.ini";
#else
const QString configPath = "";
#endif
// Set the QT_LOGGING_CONF environment variable // Set the QT_LOGGING_CONF environment variable
qputenv("QT_LOGGING_CONF", "./qtlogging.ini"); qputenv("QT_LOGGING_CONF", configPath.toStdString());
qSetMessagePattern( qSetMessagePattern(
"\033[0m[%{time yyyy-MM-dd h:mm:ss.zzz} " "\033[0m[%{time yyyy-MM-dd h:mm:ss.zzz} "
"%{if-debug}\033[36mD%{endif}%{if-info}\033[32mI%{endif}%{if-warning}\033[33mW%{endif}%{if-critical}\033[31mC%{" "%{if-debug}\033[36mD%{endif}%{if-info}\033[32mI%{endif}%{if-warning}\033[33mW%{endif}%{if-critical}\033[31mC%{"