mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Add EQEmuLogSys::GetConsoleColorFromCategory(uint16 log_category) to replace the static map
This commit is contained in:
parent
2ecb91d075
commit
2f74f07be7
@ -64,17 +64,6 @@ namespace Console {
|
||||
};
|
||||
}
|
||||
|
||||
// static Console::Color LogColors[MaxCategoryID] = {
|
||||
// Console::Color::Yellow, // "Status",
|
||||
// Console::Color::Yellow, // "Normal",
|
||||
// Console::Color::LightRed, // "Error",
|
||||
// Console::Color::LightGreen, // "Debug",
|
||||
// Console::Color::LightCyan, // "Quest",
|
||||
// Console::Color::LightMagenta, // "Command",
|
||||
// Console::Color::LightRed // "Crash"
|
||||
// };
|
||||
|
||||
|
||||
EQEmuLogSys::EQEmuLogSys(){
|
||||
on_log_gmsay_hook = [](uint16 log_type, std::string&) {};
|
||||
}
|
||||
@ -134,6 +123,27 @@ void EQEmuLogSys::ProcessLogWrite(uint16 log_category, std::string message)
|
||||
}
|
||||
}
|
||||
|
||||
uint16 EQEmuLogSys::GetConsoleColorFromCategory(uint16 log_category){
|
||||
switch (log_category) {
|
||||
case Logs::Status:
|
||||
return Console::Color::Yellow;
|
||||
case Logs::Normal:
|
||||
return Console::Color::Yellow;
|
||||
case Logs::Error:
|
||||
return Console::Color::LightRed;
|
||||
case Logs::Debug:
|
||||
return Console::Color::LightGreen;
|
||||
case Logs::Quests:
|
||||
return Console::Color::LightCyan;
|
||||
case Logs::Commands:
|
||||
return Console::Color::LightMagenta;
|
||||
case Logs::Crash:
|
||||
return Console::Color::LightRed;
|
||||
default:
|
||||
return Console::Color::White;
|
||||
}
|
||||
}
|
||||
|
||||
void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string message)
|
||||
{
|
||||
/* Check if category enabled for process */
|
||||
|
||||
@ -129,6 +129,7 @@ public:
|
||||
void Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...);
|
||||
void SetCurrentTimeStamp(char* time_stamp);
|
||||
void StartFileLogs(const std::string log_name);
|
||||
uint16 GetConsoleColorFromCategory(uint16 log_category);
|
||||
|
||||
struct LogSettings{
|
||||
uint8 log_to_file;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user