mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-04 18:46:37 +00:00
[Code] EQEmuLogSys Global to Singleton Cleanup (#4925)
* [Code] EQEmuLogSys Global to Singleton Cleanup * Post merge fix
This commit is contained in:
@@ -41,11 +41,11 @@ inline void RunTest(const std::string &test_name, int expected, int actual)
|
||||
extern Zone *zone;
|
||||
|
||||
inline void SetupZone(std::string zone_short_name, uint32 instance_id = 0) {
|
||||
LogSys.SilenceConsoleLogging();
|
||||
EQEmuLogSys::Instance()->SilenceConsoleLogging();
|
||||
|
||||
LogSys.log_settings[Logs::ZoneState].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||
LogSys.log_settings[Logs::Info].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||
LogSys.log_settings[Logs::Spawns].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||
EQEmuLogSys::Instance()->log_settings[Logs::ZoneState].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||
EQEmuLogSys::Instance()->log_settings[Logs::Info].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||
EQEmuLogSys::Instance()->log_settings[Logs::Spawns].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||
|
||||
// boot shell zone for testing
|
||||
Zone::Bootup(ZoneID(zone_short_name), 0, false);
|
||||
@@ -53,5 +53,5 @@ inline void SetupZone(std::string zone_short_name, uint32 instance_id = 0) {
|
||||
entity_list.Process();
|
||||
entity_list.MobProcess();
|
||||
|
||||
LogSys.EnableConsoleLogging();
|
||||
EQEmuLogSys::Instance()->EnableConsoleLogging();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ void ZoneCLI::TestDataBuckets(int argc, char** argv, argh::parser& cmd, std::str
|
||||
uint32 break_length = 50;
|
||||
int failed_count = 0;
|
||||
|
||||
LogSys.SilenceConsoleLogging();
|
||||
EQEmuLogSys::Instance()->SilenceConsoleLogging();
|
||||
|
||||
// boot shell zone for testing
|
||||
Zone::Bootup(ZoneID("qrg"), 0, false);
|
||||
@@ -25,13 +25,13 @@ void ZoneCLI::TestDataBuckets(int argc, char** argv, argh::parser& cmd, std::str
|
||||
entity_list.Process();
|
||||
entity_list.MobProcess();
|
||||
|
||||
EQEmuLogSys::Instance()->EnableConsoleLogging();
|
||||
|
||||
Client* client = new Client();
|
||||
client->SetCharacterId(1); // Set a dummy character ID for testing
|
||||
|
||||
LogSys.EnableConsoleLogging();
|
||||
|
||||
LogSys.log_settings[Logs::MySQLQuery].is_category_enabled = std::getenv("DEBUG") ? 1 : 0;
|
||||
LogSys.log_settings[Logs::MySQLQuery].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||
EQEmuLogSys::Instance()->log_settings[Logs::MySQLQuery].is_category_enabled = std::getenv("DEBUG") ? 1 : 0;
|
||||
EQEmuLogSys::Instance()->log_settings[Logs::MySQLQuery].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||
|
||||
// 🧹 Delete all test keys before running tests
|
||||
std::vector<std::string> test_keys_to_clear = {
|
||||
|
||||
@@ -68,7 +68,7 @@ void ZoneCLI::TestNpcHandins(int argc, char **argv, argh::parser &cmd, std::stri
|
||||
return;
|
||||
}
|
||||
|
||||
LogSys.SilenceConsoleLogging();
|
||||
EQEmuLogSys::Instance()->SilenceConsoleLogging();
|
||||
|
||||
Zone::Bootup(ZoneID("qrg"), 0, false);
|
||||
zone->StopShutdownTimer();
|
||||
@@ -426,10 +426,10 @@ void ZoneCLI::TestNpcHandins(int argc, char **argv, argh::parser &cmd, std::stri
|
||||
std::map<std::string, uint32> required;
|
||||
std::vector<EQ::ItemInstance *> items;
|
||||
|
||||
LogSys.EnableConsoleLogging();
|
||||
EQEmuLogSys::Instance()->EnableConsoleLogging();
|
||||
|
||||
// turn this on to see debugging output
|
||||
LogSys.log_settings[Logs::NpcHandin].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||
EQEmuLogSys::Instance()->log_settings[Logs::NpcHandin].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||
|
||||
for (auto &test: test_cases) {
|
||||
hand_ins.clear();
|
||||
@@ -524,7 +524,7 @@ void ZoneCLI::TestNpcHandins(int argc, char **argv, argh::parser &cmd, std::stri
|
||||
|
||||
npc->ResetHandin();
|
||||
|
||||
if (LogSys.log_settings[Logs::NpcHandin].log_to_console > 0) {
|
||||
if (EQEmuLogSys::Instance()->log_settings[Logs::NpcHandin].log_to_console > 0) {
|
||||
std::cout << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ void ZoneCLI::TestNpcHandinsMultiQuest(int argc, char **argv, argh::parser &cmd,
|
||||
uint32 break_length = 50;
|
||||
int failed_count = 0;
|
||||
|
||||
LogSys.SilenceConsoleLogging();
|
||||
EQEmuLogSys::Instance()->SilenceConsoleLogging();
|
||||
|
||||
Zone::Bootup(ZoneID("qrg"), 0, false);
|
||||
zone->StopShutdownTimer();
|
||||
@@ -93,10 +93,10 @@ void ZoneCLI::TestNpcHandinsMultiQuest(int argc, char **argv, argh::parser &cmd,
|
||||
std::map<std::string, uint32> required;
|
||||
std::vector<EQ::ItemInstance *> items;
|
||||
|
||||
LogSys.EnableConsoleLogging();
|
||||
EQEmuLogSys::Instance()->EnableConsoleLogging();
|
||||
|
||||
// turn this on to see debugging output
|
||||
LogSys.log_settings[Logs::NpcHandin].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||
EQEmuLogSys::Instance()->log_settings[Logs::NpcHandin].log_to_console = std::getenv("DEBUG") ? 3 : 0;
|
||||
|
||||
for (auto &test: test_cases) {
|
||||
required.clear();
|
||||
@@ -162,7 +162,7 @@ void ZoneCLI::TestNpcHandinsMultiQuest(int argc, char **argv, argh::parser &cmd,
|
||||
|
||||
npc->ResetHandin();
|
||||
|
||||
if (LogSys.log_settings[Logs::NpcHandin].log_to_console > 0) {
|
||||
if (EQEmuLogSys::Instance()->log_settings[Logs::NpcHandin].log_to_console > 0) {
|
||||
std::cout << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user