Sentry: add multiple more logging mechanisms, add [CHAT]

This commit is contained in:
Lion Kortlepel
2021-08-11 14:12:47 +02:00
committed by Lion
parent 5330013dc3
commit 8fada3ac04
11 changed files with 106 additions and 42 deletions

View File

@@ -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());
}