Add log aliases to make logging much easier to use (All FMT driven)

This commit is contained in:
Akkadius
2019-09-01 20:47:26 -05:00
parent db5e511af3
commit d3803045bc
41 changed files with 982 additions and 536 deletions
+18 -18
View File
@@ -47,8 +47,8 @@ ChatChannel::ChatChannel(std::string inName, std::string inOwner, std::string in
Moderated = false;
Log(Logs::Detail, Logs::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i",
Name.c_str(), Owner.c_str(), Password.c_str(), MinimumStatus);
Log(Logs::Detail, Logs::UCSServer, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i",
Name.c_str(), Owner.c_str(), Password.c_str(), MinimumStatus);
}
@@ -154,7 +154,7 @@ void ChatChannelList::SendAllChannels(Client *c) {
void ChatChannelList::RemoveChannel(ChatChannel *Channel) {
Log(Logs::Detail, Logs::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str());
Log(Logs::Detail, Logs::UCSServer, "RemoveChannel(%s)", Channel->GetName().c_str());
LinkedListIterator<ChatChannel*> iterator(ChatChannels);
@@ -175,7 +175,7 @@ void ChatChannelList::RemoveChannel(ChatChannel *Channel) {
void ChatChannelList::RemoveAllChannels() {
Log(Logs::Detail, Logs::UCS_Server, "RemoveAllChannels");
Log(Logs::Detail, Logs::UCSServer, "RemoveAllChannels");
LinkedListIterator<ChatChannel*> iterator(ChatChannels);
@@ -233,7 +233,7 @@ void ChatChannel::AddClient(Client *c) {
if(IsClientInChannel(c)) {
Log(Logs::Detail, Logs::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str());
Log(Logs::Detail, Logs::UCSServer, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str());
return;
}
@@ -242,7 +242,7 @@ void ChatChannel::AddClient(Client *c) {
int AccountStatus = c->GetAccountStatus();
Log(Logs::Detail, Logs::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str());
Log(Logs::Detail, Logs::UCSServer, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str());
LinkedListIterator<Client*> iterator(ClientsInChannel);
@@ -267,7 +267,7 @@ bool ChatChannel::RemoveClient(Client *c) {
if(!c) return false;
Log(Logs::Detail, Logs::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str());
Log(Logs::Detail, Logs::UCSServer, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str());
bool HideMe = c->GetHideMe();
@@ -304,7 +304,7 @@ bool ChatChannel::RemoveClient(Client *c) {
if((Password.length() == 0) || (RuleI(Channels, DeleteTimer) == 0))
return false;
Log(Logs::Detail, Logs::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str());
Log(Logs::Detail, Logs::UCSServer, "Starting delete timer for empty password protected channel %s", Name.c_str());
DeleteTimer.Start(RuleI(Channels, DeleteTimer) * 60000);
}
@@ -402,8 +402,8 @@ void ChatChannel::SendMessageToChannel(std::string Message, Client* Sender) {
if(ChannelClient)
{
Log(Logs::Detail, Logs::UCS_Server, "Sending message to %s from %s",
ChannelClient->GetName().c_str(), Sender->GetName().c_str());
Log(Logs::Detail, Logs::UCSServer, "Sending message to %s from %s",
ChannelClient->GetName().c_str(), Sender->GetName().c_str());
if (cv_messages[static_cast<uint32>(ChannelClient->GetClientVersion())].length() == 0) {
switch (ChannelClient->GetClientVersion()) {
@@ -505,7 +505,7 @@ ChatChannel *ChatChannelList::AddClientToChannel(std::string ChannelName, Client
return nullptr;
}
Log(Logs::Detail, Logs::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str());
Log(Logs::Detail, Logs::UCSServer, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str());
ChatChannel *RequiredChannel = FindChannel(NormalisedName);
@@ -581,7 +581,7 @@ void ChatChannelList::Process() {
if(CurrentChannel && CurrentChannel->ReadyToDelete()) {
Log(Logs::Detail, Logs::UCS_Server, "Empty temporary password protected channel %s being destroyed.",
Log(Logs::Detail, Logs::UCSServer, "Empty temporary password protected channel %s being destroyed.",
CurrentChannel->GetName().c_str());
RemoveChannel(CurrentChannel);
@@ -597,7 +597,7 @@ void ChatChannel::AddInvitee(const std::string &Invitee)
if (!IsInvitee(Invitee)) {
Invitees.push_back(Invitee);
Log(Logs::Detail, Logs::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
Log(Logs::Detail, Logs::UCSServer, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
}
}
@@ -608,7 +608,7 @@ void ChatChannel::RemoveInvitee(std::string Invitee)
if(it != std::end(Invitees)) {
Invitees.erase(it);
Log(Logs::Detail, Logs::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
Log(Logs::Detail, Logs::UCSServer, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str());
}
}
@@ -622,7 +622,7 @@ void ChatChannel::AddModerator(const std::string &Moderator)
if (!IsModerator(Moderator)) {
Moderators.push_back(Moderator);
Log(Logs::Detail, Logs::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
Log(Logs::Detail, Logs::UCSServer, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
}
}
@@ -633,7 +633,7 @@ void ChatChannel::RemoveModerator(const std::string &Moderator)
if (it != std::end(Moderators)) {
Moderators.erase(it);
Log(Logs::Detail, Logs::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
Log(Logs::Detail, Logs::UCSServer, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str());
}
}
@@ -647,7 +647,7 @@ void ChatChannel::AddVoice(const std::string &inVoiced)
if (!HasVoice(inVoiced)) {
Voiced.push_back(inVoiced);
Log(Logs::Detail, Logs::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
Log(Logs::Detail, Logs::UCSServer, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
}
}
@@ -658,7 +658,7 @@ void ChatChannel::RemoveVoice(const std::string &inVoiced)
if (it != std::end(Voiced)) {
Voiced.erase(it);
Log(Logs::Detail, Logs::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
Log(Logs::Detail, Logs::UCSServer, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str());
}
}