Make logger automatically put a newline (#675)

at the end of the line
remove all the newlines in log calls
This commit is contained in:
Aaron Kimbrell
2022-07-24 21:26:51 -05:00
committed by GitHub
parent a7fb6eb3f3
commit e97ae92624
86 changed files with 1249 additions and 1252 deletions

View File

@@ -41,10 +41,10 @@ void Database::Connect() {
void Database::Destroy(std::string source, bool log) {
if (!con) return;
if (log) {
if (source != "") Game::logger->Log("Database", "Destroying MySQL connection from %s!\n", source.c_str());
else Game::logger->Log("Database", "Destroying MySQL connection!\n");
if (source != "") Game::logger->Log("Database", "Destroying MySQL connection from %s!", source.c_str());
else Game::logger->Log("Database", "Destroying MySQL connection!");
}
con->close();
@@ -63,7 +63,7 @@ sql::PreparedStatement* Database::CreatePreppedStmt(const std::string& query) {
if (!con) {
Connect();
Game::logger->Log("Database", "Trying to reconnect to MySQL\n");
Game::logger->Log("Database", "Trying to reconnect to MySQL");
}
if (!con->isValid() || con->isClosed())
@@ -73,9 +73,9 @@ sql::PreparedStatement* Database::CreatePreppedStmt(const std::string& query) {
con = nullptr;
Connect();
Game::logger->Log("Database", "Trying to reconnect to MySQL from invalid or closed connection\n");
Game::logger->Log("Database", "Trying to reconnect to MySQL from invalid or closed connection");
}
auto* stmt = con->prepareStatement(str);
return stmt;

View File

@@ -31,7 +31,7 @@ void MigrationRunner::RunMigrations() {
delete stmt;
if (doExit) continue;
Game::logger->Log("MigrationRunner", "Running migration: " + migration.name + "\n");
Game::logger->Log("MigrationRunner", "Running migration: " + migration.name + "");
finalSQL.append(migration.data);
finalSQL.append('\n');
@@ -49,7 +49,7 @@ void MigrationRunner::RunMigrations() {
delete simpleStatement;
}
catch (sql::SQLException e) {
Game::logger->Log("MigrationRunner", std::string("Encountered error running migration: ") + e.what() + "\n");
Game::logger->Log("MigrationRunner", std::string("Encountered error running migration: ") + e.what() + "");
}
}
}
@@ -60,7 +60,7 @@ Migration MigrationRunner::LoadMigration(std::string path) {
if (file.is_open()) {
std::hash<std::string> hash;
std::string line;
std::string total = "";
@@ -73,6 +73,6 @@ Migration MigrationRunner::LoadMigration(std::string path) {
migration.name = path;
migration.data = total;
}
return migration;
}

View File

@@ -13,9 +13,9 @@ CDSkillBehaviorTable::CDSkillBehaviorTable(void) {
tableSize.nextRow();
}
tableSize.finalize();
// Reserve the size
//this->entries.reserve(size);
@@ -68,7 +68,7 @@ std::vector<CDSkillBehavior> CDSkillBehaviorTable::Query(std::function<bool(CDSk
return data;*/
//Logger::LogDebug("CDSkillBehaviorTable", "The 'Query' function is no longer working! Please use GetSkillByID instead!\n");
//Logger::LogDebug("CDSkillBehaviorTable", "The 'Query' function is no longer working! Please use GetSkillByID instead!");
std::vector<CDSkillBehavior> data; //So MSVC shuts up
return data;
}