Convert 'UCS' debugging _log to logger.LogDebugType

This commit is contained in:
Akkadius
2015-01-12 22:44:47 -06:00
parent f26f49c2a1
commit 40d32fc1e5
8 changed files with 126 additions and 120 deletions
+18 -17
View File
@@ -17,10 +17,11 @@
*/
#include "../common/eqemu_logsys.h"
#include "../common/string_util.h"
#include "chatchannel.h"
#include "clientlist.h"
#include "database.h"
#include "../common/string_util.h"
#include <cstdlib>
extern Database database;
@@ -41,7 +42,7 @@ ChatChannel::ChatChannel(std::string inName, std::string inOwner, std::string in
Moderated = false;
_log(UCS__TRACE, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i",
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i",
Name.c_str(), Owner.c_str(), Password.c_str(), MinimumStatus);
}
@@ -148,7 +149,7 @@ void ChatChannelList::SendAllChannels(Client *c) {
void ChatChannelList::RemoveChannel(ChatChannel *Channel) {
_log(UCS__TRACE, "RemoveChannel(%s)", Channel->GetName().c_str());
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str());
LinkedListIterator<ChatChannel*> iterator(ChatChannels);
@@ -169,7 +170,7 @@ void ChatChannelList::RemoveChannel(ChatChannel *Channel) {
void ChatChannelList::RemoveAllChannels() {
_log(UCS__TRACE, "RemoveAllChannels");
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveAllChannels");
LinkedListIterator<ChatChannel*> iterator(ChatChannels);
@@ -227,7 +228,7 @@ void ChatChannel::AddClient(Client *c) {
if(IsClientInChannel(c)) {
_log(UCS__ERROR, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str());
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str());
return;
}
@@ -236,7 +237,7 @@ void ChatChannel::AddClient(Client *c) {
int AccountStatus = c->GetAccountStatus();
_log(UCS__TRACE, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str());
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str());
LinkedListIterator<Client*> iterator(ClientsInChannel);
@@ -261,7 +262,7 @@ bool ChatChannel::RemoveClient(Client *c) {
if(!c) return false;
_log(UCS__TRACE, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str());
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str());
bool HideMe = c->GetHideMe();
@@ -298,7 +299,7 @@ bool ChatChannel::RemoveClient(Client *c) {
if((Password.length() == 0) || (RuleI(Channels, DeleteTimer) == 0))
return false;
_log(UCS__TRACE, "Starting delete timer for empty password protected channel %s", Name.c_str());
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str());
DeleteTimer.Start(RuleI(Channels, DeleteTimer) * 60000);
}
@@ -396,7 +397,7 @@ void ChatChannel::SendMessageToChannel(std::string Message, Client* Sender) {
if(ChannelClient)
{
_log(UCS__TRACE, "Sending message to %s from %s",
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sending message to %s from %s",
ChannelClient->GetName().c_str(), Sender->GetName().c_str());
ChannelClient->SendChannelMessage(Name, Message, Sender);
}
@@ -478,7 +479,7 @@ ChatChannel *ChatChannelList::AddClientToChannel(std::string ChannelName, Client
return nullptr;
}
_log(UCS__TRACE, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str());
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str());
ChatChannel *RequiredChannel = FindChannel(NormalisedName);
@@ -554,7 +555,7 @@ void ChatChannelList::Process() {
if(CurrentChannel && CurrentChannel->ReadyToDelete()) {
_log(UCS__TRACE, "Empty temporary password protected channel %s being destroyed.",
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Empty temporary password protected channel %s being destroyed.",
CurrentChannel->GetName().c_str());
RemoveChannel(CurrentChannel);
@@ -571,7 +572,7 @@ void ChatChannel::AddInvitee(std::string Invitee) {
Invitees.push_back(Invitee);
_log(UCS__TRACE, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
}
}
@@ -586,7 +587,7 @@ void ChatChannel::RemoveInvitee(std::string Invitee) {
Invitees.erase(Iterator);
_log(UCS__TRACE, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
return;
}
@@ -612,7 +613,7 @@ void ChatChannel::AddModerator(std::string Moderator) {
Moderators.push_back(Moderator);
_log(UCS__TRACE, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
}
}
@@ -627,7 +628,7 @@ void ChatChannel::RemoveModerator(std::string Moderator) {
Moderators.erase(Iterator);
_log(UCS__TRACE, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
return;
}
@@ -653,7 +654,7 @@ void ChatChannel::AddVoice(std::string inVoiced) {
Voiced.push_back(inVoiced);
_log(UCS__TRACE, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
}
}
@@ -668,7 +669,7 @@ void ChatChannel::RemoveVoice(std::string inVoiced) {
Voiced.erase(Iterator);
_log(UCS__TRACE, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
return;
}