DDraceNetwork Docs
server_logger.h
Go to the documentation of this file.
1#ifndef ENGINE_SERVER_SERVER_LOGGER_H
2#define ENGINE_SERVER_SERVER_LOGGER_H
3#include <base/logger.h>
4
5#include <thread>
6
7class CServer;
8
9class CServerLogger : public ILogger
10{
11 CServer *m_pServer = nullptr;
13 std::vector<CLogMessage> m_vPending;
14 std::thread::id m_MainThread;
15
16public:
17 CServerLogger(CServer *pServer);
18 void Log(const CLogMessage *pMessage) override REQUIRES(!m_PendingLock);
19 // Must be called from the main thread!
20 void OnServerDeletion();
21};
22
23#endif // ENGINE_SERVER_SERVER_LOGGER_H
Definition: lock.h:88
Definition: logger.h:19
Definition: server_logger.h:10
CServer * m_pServer
Definition: server_logger.h:11
CServerLogger(CServer *pServer)
Definition: server_logger.cpp:5
std::vector< CLogMessage > m_vPending
Definition: server_logger.h:13
void Log(const CLogMessage *pMessage) override REQUIRES(!m_PendingLock)
Definition: server_logger.cpp:12
CLock m_PendingLock
Definition: server_logger.h:12
void OnServerDeletion()
Definition: server_logger.cpp:43
std::thread::id m_MainThread
Definition: server_logger.h:14
Definition: server.h:65
Definition: logger.h:67
#define REQUIRES(...)
Definition: lock.h:32