Added a LogDebug

- Added debug logging
- Created vLog, a root function for all log functions
- Placed failed to load script log under this new LogDebug function
- Updated included config functions
This commit is contained in:
Jett
2021-12-11 12:29:34 +00:00
parent bd609dfc90
commit 74742771c4
11 changed files with 72 additions and 76 deletions

View File

@@ -45,6 +45,7 @@ int main(int argc, char** argv) {
dConfig config("authconfig.ini");
Game::config = &config;
Game::logger->SetLogToConsole(bool(std::stoi(config.GetValue("log_to_console"))));
Game::logger->SetLogDebugStatements(bool(std::stoi(config.GetValue("log_debug_statements"))));
//Connect to the MySQL Database
std::string mysql_host = config.GetValue("mysql_host");
@@ -152,11 +153,13 @@ int main(int argc, char** argv) {
dLogger * SetupLogger() {
std::string logPath = "./logs/AuthServer_" + std::to_string(time(nullptr)) + ".log";
bool logToConsole = false;
bool logDebugStatements = false;
#ifdef _DEBUG
logToConsole = true;
logDebugStatements = true;
#endif
return new dLogger(logPath, logToConsole);
return new dLogger(logPath, logToConsole, logDebugStatements);
}
void HandlePacket(Packet* packet) {