mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
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:
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user