logbuffer crash fix (#2524)

This commit is contained in:
Zach H 2017-03-22 21:39:16 -04:00 committed by GitHub
parent f688c046ab
commit 317ac05919

View file

@ -52,15 +52,17 @@ void Logger::log(QtMsgType /* type */, const QMessageLogContext & /* ctx */, con
{
logBuffer.append(message);
if (logBuffer.size() > LOGGER_MAX_ENTRIES)
logBuffer.removeFirst();
logBuffer.clear();
if (message.size() > 0)
if (message.size() > 0) {
emit logEntryAdded(message);
std::cerr << message.toStdString() << std::endl; // Print to stdout
if (logToFileEnabled)
fileStream << message << endl; // Print to fileStream
}
}