diff --git a/common/dbcore.cpp b/common/dbcore.cpp index e493042d0..47b70ca8d 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -21,6 +21,7 @@ #else #include "unix.h" +#include "timer.h" #include #endif @@ -129,29 +130,39 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo rowCount = (uint32) mysql_num_rows(res); } + BenchTimer timer; + timer.reset(); + MySQLRequestResult requestResult( res, (uint32) mysql_affected_rows(&mysql), rowCount, (uint32) mysql_field_count(&mysql), - (uint32) mysql_insert_id(&mysql)); + (uint32) mysql_insert_id(&mysql) + ); if (LogSys.log_settings[Logs::MySQLQuery].is_category_enabled == 1) { if ((strncasecmp(query, "select", 6) == 0)) { - Log(Logs::General, + LogF( + Logs::General, Logs::MySQLQuery, - "%s (%u row%s returned)", + "{0} ({1} row{2} returned) ({3}ms)", query, requestResult.RowCount(), - requestResult.RowCount() == 1 ? "" : "s"); + requestResult.RowCount() == 1 ? "" : "s", + std::to_string(timer.elapsed()) + ); } else { - Log(Logs::General, + LogF( + Logs::General, Logs::MySQLQuery, - "%s (%u row%s affected)", + "{0} ({1} row{2} affected) ({3}ms)", query, requestResult.RowsAffected(), - requestResult.RowsAffected() == 1 ? "" : "s"); + requestResult.RowsAffected() == 1 ? "" : "s", + std::to_string(timer.elapsed()) + ); } } diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 4626b0399..ecb779821 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -214,10 +214,6 @@ namespace Logs { OutF(LogSys, Logs::General, Logs::Debug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ } while (0) - - - - /** * Other */ diff --git a/loginserver/client.cpp b/loginserver/client.cpp index 41e6c16dc..c9a762da4 100644 --- a/loginserver/client.cpp +++ b/loginserver/client.cpp @@ -274,7 +274,7 @@ void Client::Handle_Login(const char *data, unsigned int size) * Login accepted */ if (result) { - LogDebug( + LogInfo( "login [{0}] user [{1}] Login succeeded", db_loginserver, user @@ -283,7 +283,7 @@ void Client::Handle_Login(const char *data, unsigned int size) DoSuccessfulLogin(user, db_account_id, db_loginserver); } else { - LogDebug( + LogInfo( "login [{0}] user [{1}] Login failed", db_loginserver, user diff --git a/loginserver/world_server.cpp b/loginserver/world_server.cpp index 74ae10a59..77be8513b 100644 --- a/loginserver/world_server.cpp +++ b/loginserver/world_server.cpp @@ -331,9 +331,7 @@ void WorldServer::ProcessUserToWorldResponse(uint16_t opcode, const EQ::Net::Pac user_to_world_response->login ); if (client) { - Log(Logs::General, - Logs::Debug, - "Found client with user id of %u and account name of %s.", + LogDebug("Found client with user id of {0} and account name of {1}", user_to_world_response->lsaccountid, client->GetAccountName().c_str() );