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()
{
if (Settings::value(Settings::Log::ToFile).toBool()) {
if (const auto file = Settings::value(Settings::Log::File).toString(); !file.isEmpty()) {
const auto logFile = qPrintable(file);
m_fileLog = new FileLogOutputter(logFile); // NOSONAR - Adopted by `Log`
CLOG->insert(m_fileLog);
LOG_DEBUG1("logging to file (%s) enabled", logFile);
}
const auto file = Settings::value(Settings::Log::File).toString();
m_fileLog = new FileLogOutputter(file); // NOSONAR - Adopted by `Log`
CLOG->insert(m_fileLog);
LOG_DEBUG1("logging to file (%s) enabled", qPrintable(file));
}
}