Simplify log calls

This commit is contained in:
Akkadius
2019-09-01 21:04:58 -05:00
parent d3803045bc
commit 98cbb7d781
21 changed files with 113 additions and 135 deletions
+4 -4
View File
@@ -42,7 +42,7 @@ void EQLConfig::LoadSettings() {
std::string query = StringFormat("SELECT dynamics FROM launcher WHERE name = '%s'", namebuf);
auto results = database.QueryDatabase(query);
if (!results.Success()) {
Log(Logs::General, Logs::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str());
LogError("EQLConfig::LoadSettings: {}", results.ErrorMessage().c_str());
}
else {
auto row = results.begin();
@@ -52,7 +52,7 @@ void EQLConfig::LoadSettings() {
query = StringFormat("SELECT zone, port FROM launcher_zones WHERE launcher = '%s'", namebuf);
results = database.QueryDatabase(query);
if (!results.Success()) {
Log(Logs::General, Logs::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str());
LogError("EQLConfig::LoadSettings: {}", results.ErrorMessage().c_str());
return;
}
@@ -199,7 +199,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) {
res = m_zones.find(short_name);
if(res == m_zones.end()) {
//not found.
Log(Logs::General, Logs::Error, "Update for unknown zone %s", short_name);
LogError("Update for unknown zone {}", short_name);
return false;
}
@@ -235,7 +235,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) {
res = m_zones.find(short_name);
if(res == m_zones.end()) {
//not found.
Log(Logs::General, Logs::Error, "Update for unknown zone %s", short_name);
LogError("Update for unknown zone {}", short_name);
return false;
}
+1 -1
View File
@@ -311,7 +311,7 @@ int main(int argc, char** argv) {
std::string hotfix_name;
if (database.GetVariable("hotfix_name", hotfix_name)) {
if (!hotfix_name.empty()) {
Log(Logs::General, Logs::ZoneServer, "Current hotfix in use: '%s'", hotfix_name.c_str());
LogInfo("Current hotfix in use: '%s'", hotfix_name.c_str());
}
}
+2 -2
View File
@@ -512,7 +512,7 @@ void WorldDatabase::GetLauncherList(std::vector<std::string> &rl) {
const std::string query = "SELECT name FROM launcher";
auto results = QueryDatabase(query);
if (!results.Success()) {
Log(Logs::General, Logs::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str());
LogError("WorldDatabase::GetLauncherList: {}", results.ErrorMessage().c_str());
return;
}
@@ -526,7 +526,7 @@ bool WorldDatabase::GetCharacterLevel(const char *name, int &level)
std::string query = StringFormat("SELECT level FROM character_data WHERE name = '%s'", name);
auto results = QueryDatabase(query);
if (!results.Success()) {
Log(Logs::General, Logs::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str());
LogError("WorldDatabase::GetCharacterLevel: {}", results.ErrorMessage().c_str());
return false;
}