mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
remove getpid usage and replace with Qt solution
This commit is contained in:
parent
c8aeab53ba
commit
3f44203984
1 changed files with 2 additions and 16 deletions
|
@ -12,15 +12,7 @@
|
|||
|
||||
#include <time.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <process.h>
|
||||
#define getpid _getpid
|
||||
#define getppid _getpid // hack to build
|
||||
#define pid_t int // hack to build
|
||||
#elif __linux__
|
||||
#include <unistd.h> // for getpid() on linux
|
||||
#endif
|
||||
|
||||
#include <qcoreapplication.h>
|
||||
#include <qdebug.h>
|
||||
#include <qtimer.h>
|
||||
|
||||
|
@ -122,14 +114,8 @@ QString LogHandler::printMessage(LogMsgType type, const QMessageLogContext& cont
|
|||
prefixString.append(QString(" [%1]").arg(dateString));
|
||||
|
||||
if (_shouldOutputPID) {
|
||||
prefixString.append(QString(" [%1").arg(getpid()));
|
||||
prefixString.append(QString(" [%1]").arg(QCoreApplication::instance()->applicationPid()));
|
||||
|
||||
pid_t parentProcessID = getppid();
|
||||
if (parentProcessID != 0) {
|
||||
prefixString.append(QString(":%1]").arg(parentProcessID));
|
||||
} else {
|
||||
prefixString.append("]");
|
||||
}
|
||||
}
|
||||
|
||||
if (!_targetName.isEmpty()) {
|
||||
|
|
Loading…
Reference in a new issue