Corpse Class Private scope variables renamed for understandability across the source

Removed ThrowDBError from the source
Implemented MySQL query error log at the root of the MySQL API
Readability changes
This commit is contained in:
Akkadius
2014-11-23 21:37:42 -06:00
parent 6b67c3736b
commit ce248d83d6
9 changed files with 246 additions and 270 deletions
+10 -9
View File
@@ -105,15 +105,6 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo
std::cout << "DB Query Error #" << mysql_errno(&mysql) << ": " << mysql_error(&mysql) << std::endl;
/* Implement Logging at the Root*/
std::cout << "\n[MYSQL ERR] " << mysql_errno(&mysql) << ": " << mysql_error(&mysql) << "\n\n" << query << "\n" << std::endl;
/* Write to log file */
std::ofstream log("eqemu_query_error_log.txt", std::ios_base::app | std::ios_base::out);
log << "[MYSQL ERR] " << mysql_error(&mysql) << "\n" << query << "\n";
log.close();
return MySQLRequestResult(nullptr, 0, 0, 0, 0, (uint32)mysql_errno(&mysql), errorBuffer);
}
@@ -123,6 +114,16 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo
#ifdef _EQDEBUG
std::cout << "DB Query Error #" << mysql_errno(&mysql) << ": " << mysql_error(&mysql) << std::endl;
#endif
/* Implement Logging at the Root */
if (mysql_errno(&mysql) > 0 && strlen(query) > 0){
std::cout << "\n[MYSQL ERR] " << mysql_errno(&mysql) << ": " << mysql_error(&mysql) << " [Query]: \n" << query << "\n" << std::endl;
/* Write to log file */
std::ofstream log("eqemu_query_error_log.txt", std::ios_base::app | std::ios_base::out);
log << "[MYSQL ERR] " << mysql_error(&mysql) << "\n" << query << "\n";
log.close();
}
return MySQLRequestResult(nullptr, 0, 0, 0, 0, mysql_errno(&mysql),errorBuffer);
}