more ServerNetwork code

This commit is contained in:
Max-Wilhelm Bruker 2012-03-04 19:23:43 +01:00
parent 6bbc76af2b
commit c9b66e4239
21 changed files with 441 additions and 35 deletions

View file

@ -31,16 +31,16 @@ ServerLogger::~ServerLogger()
flushBuffer();
}
void ServerLogger::logMessage(QString message, Server_ProtocolHandler *ssi)
void ServerLogger::logMessage(QString message, void *caller)
{
if (!logFile)
return;
bufferMutex.lock();
QString ssiString;
if (ssi)
ssiString = QString::number((qulonglong) ssi, 16) + " ";
buffer.append(QDateTime::currentDateTime().toString() + " " + QString::number((qulonglong) QThread::currentThread(), 16) + " " + ssiString + message);
QString callerString;
if (caller)
callerString = QString::number((qulonglong) caller, 16) + " ";
buffer.append(QDateTime::currentDateTime().toString() + " " + QString::number((qulonglong) QThread::currentThread(), 16) + " " + callerString + message);
bufferMutex.unlock();
emit sigFlushBuffer();