mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-04 10:12:26 +00:00
Convert MySQL Error logging to EQEmuLogSys and create MySQL Error category
This commit is contained in:
parent
acb677a4ba
commit
99dc83a9fd
@ -3,6 +3,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../common/misc_functions.h"
|
#include "../common/misc_functions.h"
|
||||||
|
#include "../common/eqemu_logsys.h"
|
||||||
|
|
||||||
#include "dbcore.h"
|
#include "dbcore.h"
|
||||||
|
|
||||||
@ -115,11 +116,7 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo
|
|||||||
|
|
||||||
/* Implement Logging at the Root */
|
/* Implement Logging at the Root */
|
||||||
if (mysql_errno(&mysql) > 0 && strlen(query) > 0){
|
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;
|
Log.Out(Logs::General, Logs::MySQLError, "%i: %s \n %s", mysql_errno(&mysql), mysql_error(&mysql), query);
|
||||||
/* 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);
|
return MySQLRequestResult(nullptr, 0, 0, 0, 0, mysql_errno(&mysql),errorBuffer);
|
||||||
|
|||||||
@ -74,6 +74,7 @@ namespace Logs{
|
|||||||
WebInterface_Server,
|
WebInterface_Server,
|
||||||
World_Server,
|
World_Server,
|
||||||
Zone_Server,
|
Zone_Server,
|
||||||
|
MySQLError,
|
||||||
MaxCategoryID /* Don't Remove this*/
|
MaxCategoryID /* Don't Remove this*/
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -114,6 +115,7 @@ namespace Logs{
|
|||||||
"WebInterface Server",
|
"WebInterface Server",
|
||||||
"World Server",
|
"World Server",
|
||||||
"Zone Server",
|
"Zone Server",
|
||||||
|
"MySQL Error",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user