mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-04 23:06:08 +00:00
Sentry: add multiple more logging mechanisms, add [CHAT]
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <thread>
|
||||
#include <zlib.h>
|
||||
|
||||
@@ -86,3 +87,15 @@ std::string ThreadName() {
|
||||
void RegisterThread(const std::string str) {
|
||||
threadNameMap[std::this_thread::get_id()] = str;
|
||||
}
|
||||
|
||||
void LogChatMessage(const std::string& name, int id, const std::string& msg) {
|
||||
std::stringstream ss;
|
||||
ss << "[CHAT] ";
|
||||
if (id != -1) {
|
||||
ss << "(" << id << ") <" << name << ">";
|
||||
} else {
|
||||
ss << name << "";
|
||||
}
|
||||
ss << msg;
|
||||
Application::Console().Write(ss.str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user