Simplify error logging

This commit is contained in:
Akkadius
2019-09-01 22:05:44 -05:00
parent 98cbb7d781
commit 678c25e02c
44 changed files with 532 additions and 486 deletions
+4 -4
View File
@@ -339,7 +339,7 @@ const EQEmu::ItemInstance* Object::GetItem(uint8 index) {
void Object::PutItem(uint8 index, const EQEmu::ItemInstance* inst)
{
if (index > 9) {
Log(Logs::General, Logs::Error, "Object::PutItem: Invalid index specified (%i)", index);
LogError("Object::PutItem: Invalid index specified ([{}])", index);
return;
}
@@ -647,7 +647,7 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob
safe_delete_array(object_name);
auto results = QueryDatabase(query);
if (!results.Success()) {
Log(Logs::General, Logs::Error, "Unable to insert object: %s", results.ErrorMessage().c_str());
LogError("Unable to insert object: [{}]", results.ErrorMessage().c_str());
return 0;
}
@@ -686,7 +686,7 @@ void ZoneDatabase::UpdateObject(uint32 id, uint32 type, uint32 icon, const Objec
safe_delete_array(object_name);
auto results = QueryDatabase(query);
if (!results.Success()) {
Log(Logs::General, Logs::Error, "Unable to update object: %s", results.ErrorMessage().c_str());
LogError("Unable to update object: [{}]", results.ErrorMessage().c_str());
return;
}
@@ -730,7 +730,7 @@ void ZoneDatabase::DeleteObject(uint32 id)
std::string query = StringFormat("DELETE FROM object WHERE id = %i", id);
auto results = QueryDatabase(query);
if (!results.Success()) {
Log(Logs::General, Logs::Error, "Unable to delete object: %s", results.ErrorMessage().c_str());
LogError("Unable to delete object: [{}]", results.ErrorMessage().c_str());
}
}