I have an issue where I am logging some in app information such as requests,messages, responses and in this segment of the code is where it happening. My goal is to see the log file while the app is running which doesn't seem to happen right now, so the user has to exit the app and then go to the public folder in order to view the logs. I can provide more information if needed.
void LogClass::log(const char* pcszComponent, const char* pcszLevel, const CF1String& title, const CF1String& message)
{
m_guard.lock();
QByteArray byteArray(QTime::currentTime().toString("HH:mm:ss.zzz").toAscii());
XXString logMessage = XXFormatString("[%s] [%7s] [%4s] [%08X] [%s] [%s]\r\n", byteArray.constData(), pcszLevel, pcszComponent, QThread::currentThreadId(), title.c_str(), message.c_str());
if (!m_pLogFile) {
createLogFile();
}
if (m_pLogFile) {
fputs(logMessage.c_str(), m_pLogFile);
fflush(m_pLogFile);
}
m_guard.unlock();
}
Thanks in advance.