Add console helpers to EQEmu::LogSys cleanup world main

This commit is contained in:
Akkadius
2019-12-23 00:39:39 -06:00
parent 8ef6feac9f
commit 2ab0ce19a7
4 changed files with 135 additions and 115 deletions
-4
View File
@@ -123,10 +123,6 @@ namespace EQEmuCommand {
bool ran_command = false;
for (auto &it: in_function_map) {
if (it.first == argv[1]) {
std::cout << std::endl;
std::cout << "> " << termcolor::cyan << "Executing CLI Command" << termcolor::reset << std::endl;
std::cout << std::endl;
(it.second)(argc, argv, cmd, description);
ran_command = true;
}
+22
View File
@@ -579,3 +579,25 @@ void EQEmuLogSys::StartFileLogs(const std::string &log_name)
);
}
}
/**
* Silence console logging
*/
void EQEmuLogSys::SilenceConsoleLogging()
{
for (int log_index = Logs::AA; log_index != Logs::MaxCategoryID; log_index++) {
log_settings[log_index].log_to_console = 0;
log_settings[log_index].is_category_enabled = 0;
}
}
/**
* Enables console logging
*/
void EQEmuLogSys::EnableConsoleLogging()
{
for (int log_index = Logs::AA; log_index != Logs::MaxCategoryID; log_index++) {
log_settings[log_index].log_to_console = Logs::General;
log_settings[log_index].is_category_enabled = 1;
}
}
+10
View File
@@ -279,6 +279,16 @@ public:
*/
void SetConsoleHandler(std::function<void(uint16 debug_level, uint16 log_type, const std::string&)> f) { on_log_console_hook = f; }
/**
* Silence console logging
*/
void SilenceConsoleLogging();
/**
* Turn on all console logging
*/
void EnableConsoleLogging();
private:
/**