Browse Source

Merge pull request #12530 from Chocobo1/logger

Reduce padding in structure
adaptive-webui-19844
Mike Tzou 5 years ago committed by GitHub
parent
commit
30ce2dfdf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/base/logger.cpp
  2. 4
      src/base/logger.h

4
src/base/logger.cpp

@ -72,7 +72,7 @@ void Logger::freeInstance() @@ -72,7 +72,7 @@ void Logger::freeInstance()
void Logger::addMessage(const QString &message, const Log::MsgType &type)
{
QWriteLocker locker(&m_lock);
const Log::Msg msg = {m_msgCounter++, QDateTime::currentMSecsSinceEpoch(), type, message};
const Log::Msg msg = {m_msgCounter++, type, QDateTime::currentMSecsSinceEpoch(), message};
m_messages.push_back(msg);
locker.unlock();
@ -82,7 +82,7 @@ void Logger::addMessage(const QString &message, const Log::MsgType &type) @@ -82,7 +82,7 @@ void Logger::addMessage(const QString &message, const Log::MsgType &type)
void Logger::addPeer(const QString &ip, const bool blocked, const QString &reason)
{
QWriteLocker locker(&m_lock);
const Log::Peer msg = {m_peerCounter++, QDateTime::currentMSecsSinceEpoch(), ip, blocked, reason};
const Log::Peer msg = {m_peerCounter++, blocked, QDateTime::currentMSecsSinceEpoch(), ip, reason};
m_peers.push_back(msg);
locker.unlock();

4
src/base/logger.h

@ -53,17 +53,17 @@ namespace Log @@ -53,17 +53,17 @@ namespace Log
struct Msg
{
int id;
qint64 timestamp;
MsgType type;
qint64 timestamp;
QString message;
};
struct Peer
{
int id;
bool blocked;
qint64 timestamp;
QString ip;
bool blocked;
QString reason;
};
}

Loading…
Cancel
Save