fix: Mac os log file not working

fixes: #9274
The log file path is not able to be empty since Settings::value will return the default path if it is, Do not send a c_str to create our FileLogger it wants a QString
This commit is contained in:
sithlord48 2025-12-12 20:43:39 -05:00 committed by Nick Bolton
parent ef734a869c
commit 5e347d8725

View file

@ -110,12 +110,10 @@ int App::daemonMainLoop(int, const char **)
void App::setupFileLogging() void App::setupFileLogging()
{ {
if (Settings::value(Settings::Log::ToFile).toBool()) { if (Settings::value(Settings::Log::ToFile).toBool()) {
if (const auto file = Settings::value(Settings::Log::File).toString(); !file.isEmpty()) { const auto file = Settings::value(Settings::Log::File).toString();
const auto logFile = qPrintable(file); m_fileLog = new FileLogOutputter(file); // NOSONAR - Adopted by `Log`
m_fileLog = new FileLogOutputter(logFile); // NOSONAR - Adopted by `Log` CLOG->insert(m_fileLog);
CLOG->insert(m_fileLog); LOG_DEBUG1("logging to file (%s) enabled", qPrintable(file));
LOG_DEBUG1("logging to file (%s) enabled", logFile);
}
} }
} }