formatting
4 space indent + code flow rewrite for easier readability.
This commit is contained in:
parent
b83fe95b05
commit
f685bd2abe
1 changed files with 83 additions and 82 deletions
|
@ -52,11 +52,13 @@ void ServerLogger::logMessage(QString message, void *caller)
|
|||
//filter out all log entries based on values in configuration file
|
||||
QSettings *settings = new QSettings("servatrice.ini", QSettings::IniFormat);
|
||||
bool shouldWeWriteLog = settings->value("server/writelog").toBool();
|
||||
|
||||
if (shouldWeWriteLog){
|
||||
QString logFilters = settings->value("server/logfilters").toString();
|
||||
QStringList listlogFilters = logFilters.split(",", QString::SkipEmptyParts);
|
||||
bool shouldWeSkipLine = false;
|
||||
|
||||
if (!shouldWeWriteLog)
|
||||
return;
|
||||
|
||||
if (!logFilters.trimmed().isEmpty()){
|
||||
shouldWeSkipLine = true;
|
||||
foreach(QString logFilter, listlogFilters){
|
||||
|
@ -74,7 +76,6 @@ void ServerLogger::logMessage(QString message, void *caller)
|
|||
buffer.append(QDateTime::currentDateTime().toString() + " " + callerString + message);
|
||||
bufferMutex.unlock();
|
||||
emit sigFlushBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
void ServerLogger::flushBuffer()
|
||||
|
|
Loading…
Reference in a new issue