Renamed DebugCategory to DoLog as the aggregate logging function for simplicity of use and shortened syntax of Log.DoLog

This commit is contained in:
Akkadius
2015-01-18 01:54:09 -06:00
parent af8ab89a36
commit 1c048cb1d1
119 changed files with 2653 additions and 2653 deletions
+15 -15
View File
@@ -38,22 +38,22 @@ int main(int argc, char **argv) {
Log.LoadLogSettingsDefaults();
set_exception_handler();
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Export Utility");
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Export Utility");
if(!EQEmuConfig::LoadConfig()) {
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file.");
Log.DoLog(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.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str());
}
SharedDatabase database;
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database...");
Log.DoLog(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.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a "
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a "
"database connection");
return 1;
}
@@ -66,11 +66,11 @@ int main(int argc, char **argv) {
}
void ExportSpells(SharedDatabase *db) {
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Spells...");
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Spells...");
FILE *f = fopen("export/spells_us.txt", "w");
if(!f) {
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping.");
Log.DoLog(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.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.DoLog(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.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.DoLog(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.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
return 0;
}
@@ -140,11 +140,11 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) {
}
void ExportSkillCaps(SharedDatabase *db) {
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Skill Caps...");
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Skill Caps...");
FILE *f = fopen("export/SkillCaps.txt", "w");
if(!f) {
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping.");
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping.");
return;
}
@@ -169,11 +169,11 @@ void ExportSkillCaps(SharedDatabase *db) {
}
void ExportBaseData(SharedDatabase *db) {
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Base Data...");
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Base Data...");
FILE *f = fopen("export/BaseData.txt", "w");
if(!f) {
Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping.");
Log.DoLog(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.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str());
}
fclose(f);