Consolidate 'LogType' Error logs over to 'LogCategory'

This commit is contained in:
Akkadius
2015-01-18 01:30:25 -06:00
parent b3fc0ab06d
commit e691735a2d
61 changed files with 594 additions and 594 deletions
+10 -10
View File
@@ -40,20 +40,20 @@ int main(int argc, char **argv) {
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Export Utility");
if(!EQEmuConfig::LoadConfig()) {
Log.Log(EQEmuLogSys::Error, "Unable to load configuration file.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file.");
return 1;
}
const EQEmuConfig *config = EQEmuConfig::get();
if(!load_log_settings(config->LogSettingsFile.c_str())) {
Log.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
}
SharedDatabase database;
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database...");
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a "
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a "
"database connection");
return 1;
}
@@ -70,7 +70,7 @@ void ExportSpells(SharedDatabase *db) {
FILE *f = fopen("export/spells_us.txt", "w");
if(!f) {
Log.Log(EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping.");
return;
}
@@ -94,7 +94,7 @@ void ExportSpells(SharedDatabase *db) {
fprintf(f, "%s\n", line.c_str());
}
} else {
Log.Log(EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
}
fclose(f);
@@ -108,7 +108,7 @@ bool SkillUsable(SharedDatabase *db, int skill_id, int class_id) {
class_id, skill_id);
auto results = db->QueryDatabase(query);
if(!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
return false;
}
@@ -128,7 +128,7 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) {
class_id, skill_id, level);
auto results = db->QueryDatabase(query);
if (!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
return 0;
}
@@ -144,7 +144,7 @@ void ExportSkillCaps(SharedDatabase *db) {
FILE *f = fopen("export/SkillCaps.txt", "w");
if(!f) {
Log.Log(EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping.");
return;
}
@@ -173,7 +173,7 @@ void ExportBaseData(SharedDatabase *db) {
FILE *f = fopen("export/BaseData.txt", "w");
if(!f) {
Log.Log(EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping.");
return;
}
@@ -195,7 +195,7 @@ void ExportBaseData(SharedDatabase *db) {
fprintf(f, "%s\n", line.c_str());
}
} else {
Log.Log(EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
}
fclose(f);
+7 -7
View File
@@ -38,20 +38,20 @@ int main(int argc, char **argv) {
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Import Utility");
if(!EQEmuConfig::LoadConfig()) {
Log.Log(EQEmuLogSys::Error, "Unable to load configuration file.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file.");
return 1;
}
const EQEmuConfig *config = EQEmuConfig::get();
if(!load_log_settings(config->LogSettingsFile.c_str())) {
Log.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
}
SharedDatabase database;
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database...");
if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(),
config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) {
Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a "
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a "
"database connection");
return 1;
}
@@ -68,7 +68,7 @@ int GetSpellColumns(SharedDatabase *db) {
const std::string query = "DESCRIBE spells_new";
auto results = db->QueryDatabase(query);
if(!results.Success()) {
Log.Log(EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
return 0;
}
@@ -79,7 +79,7 @@ void ImportSpells(SharedDatabase *db) {
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Spells...");
FILE *f = fopen("import/spells_us.txt", "r");
if(!f) {
Log.Log(EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping.");
return;
}
@@ -158,7 +158,7 @@ void ImportSkillCaps(SharedDatabase *db) {
FILE *f = fopen("import/SkillCaps.txt", "r");
if(!f) {
Log.Log(EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping.");
return;
}
@@ -194,7 +194,7 @@ void ImportBaseData(SharedDatabase *db) {
FILE *f = fopen("import/BaseData.txt", "r");
if(!f) {
Log.Log(EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping.");
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping.");
return;
}