mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
more ServerNetwork code
This commit is contained in:
parent
6bbc76af2b
commit
c9b66e4239
21 changed files with 441 additions and 35 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue