8 #define RGB(r, g, b) "\033[38;2;" #r ";" #g ";" #b "m" 12 LogManager::LogManager() {
14 static std::mutex mutex;
15 std::lock_guard<std::mutex> lock(mutex);
16 const char *file = m.file();
17 if (
auto *c = std::strrchr(file,
'/')) {
20 const char *color = RGB(255, 255, 255);
23 color = RGB(220, 220, 220);
26 color = RGB(255, 255, 255)
"\e[1m";
29 color = RGB(255, 255, 0)
"\e[1m";
32 color = RGB(255, 50, 0)
"\e[1m";
35 color = RGB(255, 50, 0)
"\e[1m";
37 case LogLevel::Success:
38 color = RGB(50, 255, 0)
"\e[1m";
41 std::cout << color << m.message() << RESET << RGB(100, 100, 100) <<
" " 42 << m.function() <<
" " << file <<
":" << m.line() <<
" " 43 << m.node() << RESET << NEWLINE;
48 LogManager &LogManager::instance() {
return g_log_manager_instance; }