diff options
| author | Spp <spp@jorge.gr> | 2013-05-13 15:07:36 +0200 |
|---|---|---|
| committer | Spp <spp@jorge.gr> | 2013-05-13 15:07:36 +0200 |
| commit | d1677b2db08f71a5bddedd9659cc5a66f325f47f (patch) | |
| tree | afb68e15d84d4e64de9f80b9bbbeb126c4aa8c54 /src/server/worldserver/TCSoap | |
| parent | 243c325ca4323feb4f7f80c0ecd3873c78cbf887 (diff) | |
Core/Logging: Performance-related tweaks to logging system
All sLog->out* functions (except outCommand atm) are replaced with TC_LOG_* macros.
Memleak fix
Diffstat (limited to 'src/server/worldserver/TCSoap')
| -rw-r--r-- | src/server/worldserver/TCSoap/TCSoap.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/server/worldserver/TCSoap/TCSoap.cpp b/src/server/worldserver/TCSoap/TCSoap.cpp index dd82c6ce0c7..3ccc3bccac9 100644 --- a/src/server/worldserver/TCSoap/TCSoap.cpp +++ b/src/server/worldserver/TCSoap/TCSoap.cpp @@ -35,18 +35,18 @@ void TCSoapRunnable::run() soap.send_timeout = 5; if (!soap_valid_socket(soap_bind(&soap, m_host.c_str(), m_port, 100))) { - sLog->outError(LOG_FILTER_SOAP, "Couldn't bind to %s:%d", m_host.c_str(), m_port); + TC_LOG_ERROR(LOG_FILTER_SOAP, "Couldn't bind to %s:%d", m_host.c_str(), m_port); exit(-1); } - sLog->outInfo(LOG_FILTER_SOAP, "Bound to http://%s:%d", m_host.c_str(), m_port); + TC_LOG_INFO(LOG_FILTER_SOAP, "Bound to http://%s:%d", m_host.c_str(), m_port); while (!World::IsStopped()) { if (!soap_valid_socket(soap_accept(&soap))) continue; // ran into an accept timeout - sLog->outDebug(LOG_FILTER_SOAP, "Accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF); + TC_LOG_DEBUG(LOG_FILTER_SOAP, "Accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF); struct soap* thread_soap = soap_copy(&soap);// make a safe copy ACE_Message_Block* mb = new ACE_Message_Block(sizeof(struct soap*)); @@ -81,33 +81,33 @@ int ns1__executeCommand(soap* soap, char* command, char** result) // security check if (!soap->userid || !soap->passwd) { - sLog->outInfo(LOG_FILTER_SOAP, "Client didn't provide login information"); + TC_LOG_INFO(LOG_FILTER_SOAP, "Client didn't provide login information"); return 401; } uint32 accountId = AccountMgr::GetId(soap->userid); if (!accountId) { - sLog->outInfo(LOG_FILTER_SOAP, "Client used invalid username '%s'", soap->userid); + TC_LOG_INFO(LOG_FILTER_SOAP, "Client used invalid username '%s'", soap->userid); return 401; } if (!AccountMgr::CheckPassword(accountId, soap->passwd)) { - sLog->outInfo(LOG_FILTER_SOAP, "Invalid password for account '%s'", soap->userid); + TC_LOG_INFO(LOG_FILTER_SOAP, "Invalid password for account '%s'", soap->userid); return 401; } if (AccountMgr::GetSecurity(accountId) < SEC_ADMINISTRATOR) { - sLog->outInfo(LOG_FILTER_SOAP, "%s's gmlevel is too low", soap->userid); + TC_LOG_INFO(LOG_FILTER_SOAP, "%s's gmlevel is too low", soap->userid); return 403; } if (!command || !*command) return soap_sender_fault(soap, "Command can not be empty", "The supplied command was an empty string"); - sLog->outInfo(LOG_FILTER_SOAP, "Received command '%s'", command); + TC_LOG_INFO(LOG_FILTER_SOAP, "Received command '%s'", command); SOAPCommand connection; // commands are executed in the world thread. We have to wait for them to be completed @@ -122,7 +122,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result) int acc = connection.pendingCommands.acquire(); if (acc) { - sLog->outError(LOG_FILTER_SOAP, "Error while acquiring lock, acc = %i, errno = %u", acc, errno); + TC_LOG_ERROR(LOG_FILTER_SOAP, "Error while acquiring lock, acc = %i, errno = %u", acc, errno); } // alright, command finished |
