mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 22:18:19 +00:00
24 lines
506 B
C
24 lines
506 B
C
|
#ifndef ENGINE_SERVER_SERVER_LOGGER_H
|
||
|
#define ENGINE_SERVER_SERVER_LOGGER_H
|
||
|
#include <base/logger.h>
|
||
|
|
||
|
#include <thread>
|
||
|
|
||
|
class CServer;
|
||
|
|
||
|
class CServerLogger : public ILogger
|
||
|
{
|
||
|
CServer *m_pServer = nullptr;
|
||
|
std::mutex m_PendingLock;
|
||
|
std::vector<CLogMessage> m_vPending;
|
||
|
std::thread::id m_MainThread;
|
||
|
|
||
|
public:
|
||
|
CServerLogger(CServer *pServer);
|
||
|
void Log(const CLogMessage *pMessage) override;
|
||
|
// Must be called from the main thread!
|
||
|
void OnServerDeletion();
|
||
|
};
|
||
|
|
||
|
#endif // ENGINE_SERVER_SERVER_LOGGER_H
|