diff options
| author | DukePyrolator <DukePyrolator@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-01-31 06:15:29 +0000 |
|---|---|---|
| committer | DukePyrolator <DukePyrolator@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-01-31 06:15:29 +0000 |
| commit | aa4b3e256377030d291fc2d5f4db94985ce04395 (patch) | |
| tree | 993302c0cbe754612f69c22bbbc57d00220cabd4 /src/core | |
| parent | 47504c9de5accda45a19627fd2b6ec13baa6ba95 (diff) | |
replaced the alog() command with a new type-safe and stream-based Alog()
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2777 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core')
42 files changed, 156 insertions, 192 deletions
diff --git a/src/core/bs_kick.c b/src/core/bs_kick.c index 37cd742f5..be0815a29 100644 --- a/src/core/bs_kick.c +++ b/src/core/bs_kick.c @@ -46,15 +46,12 @@ class CommandBSKick : public Command if (value == "ON") { if (ttb) { errno = 0; - ci->ttb[TTB_BADWORDS] = - strtol(ttb, NULL, 10); + ci->ttb[TTB_BADWORDS] = strtol(ttb, NULL, 10); /* Only error if errno returns ERANGE or EINVAL or we are less then 0 - TSL */ - if (errno == ERANGE || errno == EINVAL - || ci->ttb[TTB_BADWORDS] < 0) { + if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_BADWORDS] < 0) + { /* leaving the debug behind since we might want to know what these are */ - if (debug) { - alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_BADWORDS]); - } + Alog(LOG_DEBUG) << "errno is " << errno << " ERANGE " << ERANGE << " EINVAL " << EINVAL << " ttb " << ci->ttb[TTB_BADWORDS]; /* reset the value back to 0 - TSL */ ci->ttb[TTB_BADWORDS] = 0; notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb); @@ -78,11 +75,9 @@ class CommandBSKick : public Command if (ttb) { errno = 0; ci->ttb[TTB_BOLDS] = strtol(ttb, NULL, 10); - if (errno == ERANGE || errno == EINVAL - || ci->ttb[TTB_BOLDS] < 0) { - if (debug) { - alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_BOLDS]); - } + if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_BOLDS] < 0) + { + Alog(LOG_DEBUG) << "errno is " << errno << " ERANGE " << ERANGE << " EINVAL " << EINVAL << " ttb " << ci->ttb[TTB_BOLDS]; ci->ttb[TTB_BOLDS] = 0; notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb); return MOD_CONT; @@ -107,11 +102,9 @@ class CommandBSKick : public Command if (ttb) { errno = 0; ci->ttb[TTB_CAPS] = strtol(ttb, NULL, 10); - if (errno == ERANGE || errno == EINVAL - || ci->ttb[TTB_CAPS] < 0) { - if (debug) { - alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_CAPS]); - } + if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_CAPS] < 0) + { + Alog(LOG_DEBUG) << "errno is " << errno << " ERANGE " << ERANGE << " EINVAL " << EINVAL << " ttb " << ci->ttb[TTB_CAPS]; ci->ttb[TTB_CAPS] = 0; notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb); return MOD_CONT; @@ -150,11 +143,9 @@ class CommandBSKick : public Command if (ttb) { errno = 0; ci->ttb[TTB_COLORS] = strtol(ttb, NULL, 10); - if (errno == ERANGE || errno == EINVAL - || ci->ttb[TTB_COLORS] < 0) { - if (debug) { - alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_COLORS]); - } + if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_COLORS] < 0) + { + Alog(LOG_DEBUG) << "errno is " << errno << " ERANGE " << ERANGE << " EINVAL " << EINVAL << " ttb " << ci->ttb[TTB_COLORS]; ci->ttb[TTB_COLORS] = 0; notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb); return MOD_CONT; @@ -179,11 +170,8 @@ class CommandBSKick : public Command if (ttb) { errno = 0; ci->ttb[TTB_FLOOD] = strtol(ttb, NULL, 10); - if (errno == ERANGE || errno == EINVAL - || ci->ttb[TTB_FLOOD] < 0) { - if (debug) { - alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_FLOOD]); - } + if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_FLOOD] < 0) { + Alog(LOG_DEBUG) << "errno is " << errno << " ERANGE " << ERANGE << " EINVAL " << EINVAL << " ttb " << ci->ttb[TTB_FLOOD]; ci->ttb[TTB_FLOOD] = 0; notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb); return MOD_CONT; @@ -224,11 +212,9 @@ class CommandBSKick : public Command if (ttb) { errno = 0; ci->ttb[TTB_REPEAT] = strtol(ttb, NULL, 10); - if (errno == ERANGE || errno == EINVAL - || ci->ttb[TTB_REPEAT] < 0) { - if (debug) { - alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_REPEAT]); - } + if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_REPEAT] < 0) + { + Alog(LOG_DEBUG) << "errno is " << errno << " ERANGE " << ERANGE << " EINVAL " << EINVAL << " ttb " << ci->ttb[TTB_REPEAT]; ci->ttb[TTB_REPEAT] = 0; notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb); return MOD_CONT; @@ -260,11 +246,9 @@ class CommandBSKick : public Command errno = 0; ci->ttb[TTB_REVERSES] = strtol(ttb, NULL, 10); - if (errno == ERANGE || errno == EINVAL - || ci->ttb[TTB_REVERSES] < 0) { - if (debug) { - alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_REVERSES]); - } + if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_REVERSES] < 0) + { + Alog(LOG_DEBUG) << "errno is " << errno << " ERANGE " << ERANGE << " EINVAL " << EINVAL << " ttb " << ci->ttb[TTB_REVERSES]; ci->ttb[TTB_REVERSES] = 0; notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb); return MOD_CONT; @@ -287,11 +271,9 @@ class CommandBSKick : public Command errno = 0; ci->ttb[TTB_UNDERLINES] = strtol(ttb, NULL, 10); - if (errno == ERANGE || errno == EINVAL - || ci->ttb[TTB_UNDERLINES] < 0) { - if (debug) { - alog("debug: errno is %d ERANGE %d EINVAL %d ttb %d", errno, ERANGE, EINVAL, ci->ttb[TTB_UNDERLINES]); - } + if (errno == ERANGE || errno == EINVAL || ci->ttb[TTB_UNDERLINES] < 0) + { + Alog(LOG_DEBUG) << "errno is " << errno << " ERANGE " << ERANGE << " EINVAL " << EINVAL << " ttb " << ci->ttb[TTB_UNDERLINES]; ci->ttb[TTB_UNDERLINES] = 0; notice_lang(Config.s_BotServ, u, BOT_KICK_BAD_TTB, ttb); return MOD_CONT; diff --git a/src/core/cs_access.c b/src/core/cs_access.c index ec62dec42..808141aa0 100644 --- a/src/core/cs_access.c +++ b/src/core/cs_access.c @@ -227,7 +227,8 @@ class CommandCSAccess : public Command FOREACH_MOD(I_OnAccessChange, OnAccessChange(ci, u, na->nick, level)); - alog("%s: %s!%s@%s (level %d) set access level %d to %s (group %s) on channel %s", Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, ulev, access->level, na->nick, nc->display, ci->name.c_str()); + Alog() << Config.s_ChanServ << ": " << u->GetMask() << " (level " << ulev << ") set access level " + << access->level << " to " << na->nick << " (group " << nc->display << ") on channel " << ci->name; notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_LEVEL_CHANGED, nc->display, chan, level); return MOD_CONT; } @@ -243,7 +244,8 @@ class CommandCSAccess : public Command FOREACH_MOD(I_OnAccessAdd, OnAccessAdd(ci, u, na->nick, level)); - alog("%s: %s!%s@%s (level %d) set access level %d to %s (group %s) on channel %s", Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, ulev, level, na->nick, nc->display, ci->name.c_str()); + Alog() << Config.s_ChanServ << ": " << u->GetMask() << " (level " << ulev << ") set access level " + << level << " to " << na->nick << " (group " << nc->display << ") on channel " << ci->name; notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_ADDED, nc->display, ci->name.c_str(), level); } else if (cmd == "DEL") @@ -280,7 +282,8 @@ class CommandCSAccess : public Command } else { - alog("%s: %s!%s@%s (level %d) deleted access of user%s %s on %s", Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, get_access(u, ci), deleted == 1 ? "" : "s", nick, chan); + Alog() << Config.s_ChanServ << ": " << u->GetMask() << " (level " << get_access(u, ci) + << ") deleted access of user" << (deleted == 1 ? " " : "s ") << nick << " on " << chan; if (deleted == 1) notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_DELETED_ONE, ci->name.c_str()); else @@ -310,7 +313,8 @@ class CommandCSAccess : public Command else { notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_DELETED, access->nc->display, ci->name.c_str()); - alog("%s: %s!%s@%s (level %d) deleted access of %s (group %s) on %s", Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, get_access(u, ci), na->nick, access->nc->display, chan); + Alog() << Config.s_ChanServ << ": " << u->GetMask() << " (level " << get_access(u, ci) + << ") deleted access of " << na->nick << " (group " << access->nc->display << ") on " << chan; access->nc = NULL; access->in_use = 0; deleted = 1; @@ -403,10 +407,7 @@ class CommandCSAccess : public Command FOREACH_MOD(I_OnAccessClear, OnAccessClear(ci, u)); notice_lang(Config.s_ChanServ, u, CHAN_ACCESS_CLEAR, ci->name.c_str()); - alog("%s: %s!%s@%s (level %d) cleared access list on %s", - Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, - get_access(u, ci), chan); - + Alog() << Config.s_ChanServ << ": " << u->GetMask() << " (level " << get_access(u, ci) << " cleared access list on " << chan; } else this->OnSyntaxError(u, ""); @@ -473,9 +474,8 @@ class CommandCSLevels : public Command if (stricmp(levelinfo[i].name, what) == 0) { ci->levels[levelinfo[i].what] = level; - alog("%s: %s!%s@%s set level %s on channel %s to %d", - Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, - levelinfo[i].name, ci->name.c_str(), level); + Alog() << Config.s_ChanServ << ": " << u->GetMask() << " set level " << levelinfo[i].name + << " on channel " << ci->name << " to " << level; notice_lang(Config.s_ChanServ, u, CHAN_LEVELS_CHANGED, levelinfo[i].name, chan, level); return MOD_CONT; @@ -489,9 +489,8 @@ class CommandCSLevels : public Command if (stricmp(levelinfo[i].name, what) == 0) { ci->levels[levelinfo[i].what] = ACCESS_INVALID; - alog("%s: %s!%s@%s disabled level %s on channel %s", - Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, - levelinfo[i].name, ci->name.c_str()); + Alog() << Config.s_ChanServ << ": " << u->GetMask() << " disabled level " << levelinfo[i].name + << " on channel " << ci->name; notice_lang(Config.s_ChanServ, u, CHAN_LEVELS_DISABLED, levelinfo[i].name, chan); return MOD_CONT; @@ -536,8 +535,7 @@ class CommandCSLevels : public Command } else if (cmd == "RESET") { reset_levels(ci); - alog("%s: %s!%s@%s reset levels definitions on channel %s", - Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, ci->name.c_str()); + Alog() << Config.s_ChanServ << ": " << u->GetMask() << " reset levels definitions on channel " << ci->name; notice_lang(Config.s_ChanServ, u, CHAN_LEVELS_RESET, chan); } else { this->OnSyntaxError(u, ""); diff --git a/src/core/cs_drop.c b/src/core/cs_drop.c index 7c085ea1a..1a94d9ff6 100644 --- a/src/core/cs_drop.c +++ b/src/core/cs_drop.c @@ -70,9 +70,8 @@ class CommandCSDrop : public Command ircdproto->SendSQLineDel(ci->name.c_str()); } - alog("%s: Channel %s dropped by %s!%s@%s (founder: %s)", - Config.s_ChanServ, ci->name.c_str(), u->nick.c_str(), u->GetIdent().c_str(), - u->host, (ci->founder ? ci->founder->display : "(none)")); + Alog() << Config.s_ChanServ << ": Channel " << ci->name << " dropped by " << u->GetMask() << " (founder: " + << (ci->founder ? ci->founder->display : "(none)") << ")"; delete ci; diff --git a/src/core/cs_forbid.c b/src/core/cs_forbid.c index 57a0b552b..64a707c8f 100644 --- a/src/core/cs_forbid.c +++ b/src/core/cs_forbid.c @@ -55,7 +55,7 @@ class CommandCSForbid : public Command ci = new ChannelInfo(chan); if (!ci) { - alog("%s: Valid FORBID for %s by %s failed", Config.s_ChanServ, ci->name.c_str(), u->nick.c_str()); + Alog() << Config.s_ChanServ << ": Valid FORBID for " << ci->name << " by " << u->nick << " failed"; notice_lang(Config.s_ChanServ, u, CHAN_FORBID_FAILED, chan); return MOD_CONT; } @@ -91,7 +91,7 @@ class CommandCSForbid : public Command ircdproto->SendSQLine(ci->name, reason ? reason : "Forbidden"); } - alog("%s: %s set FORBID for channel %s", Config.s_ChanServ, u->nick.c_str(), ci->name.c_str()); + Alog() << Config.s_ChanServ << ": " << u->nick << " set FORBID for channel " << ci->name; notice_lang(Config.s_ChanServ, u, CHAN_FORBID_SUCCEEDED, chan); FOREACH_MOD(I_OnChanForbidden, OnChanForbidden(ci)); diff --git a/src/core/cs_register.c b/src/core/cs_register.c index d934afb6e..67c4d0ff7 100644 --- a/src/core/cs_register.c +++ b/src/core/cs_register.c @@ -55,7 +55,7 @@ class CommandCSRegister : public Command notice_lang(Config.s_ChanServ, u, u->nc->channelcount > Config.CSMaxReg ? CHAN_EXCEEDED_CHANNEL_LIMIT : CHAN_REACHED_CHANNEL_LIMIT, Config.CSMaxReg); else if (!(ci = new ChannelInfo(chan))) { - alog("%s: makechan() failed for REGISTER %s", Config.s_ChanServ, chan); + Alog() << Config.s_ChanServ << ": makechan() failed for REGISTER " << chan; notice_lang(Config.s_ChanServ, u, CHAN_REGISTRATION_FAILED); } else @@ -76,7 +76,7 @@ class CommandCSRegister : public Command ci->bi = NULL; ++ci->founder->channelcount; - alog("%s: Channel '%s' registered by %s!%s@%s", Config.s_ChanServ, chan, u->nick.c_str(), u->GetIdent().c_str(), u->host); + Alog() << Config.s_ChanServ << ": Channel '" << chan << "' registered by " << u->GetMask(); notice_lang(Config.s_ChanServ, u, CHAN_REGISTERED, chan, u->nick.c_str()); /* Implement new mode lock */ diff --git a/src/core/cs_set.c b/src/core/cs_set.c index 158987acd..2d8981072 100644 --- a/src/core/cs_set.c +++ b/src/core/cs_set.c @@ -42,9 +42,8 @@ class CommandCSSet : public Command return MOD_CONT; } - alog("%s: Changing founder of %s from %s to %s by %s!%s@%s", - Config.s_ChanServ, ci->name.c_str(), ci->founder->display, nc->display, u->nick.c_str(), - u->GetIdent().c_str(), u->host); + Alog() << Config.s_ChanServ << ": Changing founder of " << ci->name << " from " << ci->founder->display + << " to " << nc->display << " by " << u->GetMask(); /* Founder and successor must not be the same group */ if (nc == ci->successor) @@ -88,10 +87,9 @@ class CommandCSSet : public Command else nc = NULL; - alog("%s: Changing successor of %s from %s to %s by %s!%s@%s", - Config.s_ChanServ, ci->name.c_str(), - (ci->successor ? ci->successor->display : "none"), - (nc ? nc->display : "none"), u->nick.c_str(), u->GetIdent().c_str(), u->host); + Alog() << Config.s_ChanServ << ": Changing successor of " << ci->name << " from " + << (ci->successor ? ci->successor->display : "none") + << " to " << (nc ? nc->display : "none") << " by " << u->GetMask(); ci->successor = nc; @@ -500,16 +498,14 @@ class CommandCSSet : public Command ci->SetFlag(CI_XOP); } - alog("%s: %s!%s@%s enabled XOP for %s", Config.s_ChanServ, u->nick.c_str(), - u->GetIdent().c_str(), u->host, ci->name.c_str()); + Alog() << Config.s_ChanServ << ": " << u->GetMask() << " enabled XOP for " << ci->name; notice_lang(Config.s_ChanServ, u, CHAN_SET_XOP_ON, ci->name.c_str()); } else if (param == "OFF") { ci->UnsetFlag(CI_XOP); - alog("%s: %s!%s@%s disabled XOP for %s", Config.s_ChanServ, u->nick.c_str(), - u->GetIdent().c_str(), u->host, ci->name.c_str()); + Alog() << Config.s_ChanServ << ": " << u->GetMask() << " disabled XOP for " << ci->name; notice_lang(Config.s_ChanServ, u, CHAN_SET_XOP_OFF, ci->name.c_str()); } else diff --git a/src/core/cs_suspend.c b/src/core/cs_suspend.c index 03a058629..d356e36e2 100644 --- a/src/core/cs_suspend.c +++ b/src/core/cs_suspend.c @@ -76,14 +76,14 @@ class CommandCSSuspend : public Command if (Config.WallForbid) ircdproto->SendGlobops(findbot(Config.s_ChanServ), "\2%s\2 used SUSPEND on channel \2%s\2", u->nick.c_str(), ci->name.c_str()); - alog("%s: %s set SUSPEND for channel %s", Config.s_ChanServ, u->nick.c_str(), ci->name.c_str()); + Alog() << Config.s_ChanServ << ": " << u->GetMask() << " set SUSPEND for channel " << ci->name; notice_lang(Config.s_ChanServ, u, CHAN_SUSPEND_SUCCEEDED, chan); FOREACH_MOD(I_OnChanSuspend, OnChanSuspend(ci)); } else { - alog("%s: Valid SUSPEND for %s by %s failed", Config.s_ChanServ, ci->name.c_str(), u->nick.c_str()); + Alog() << Config.s_ChanServ << ": Valid SUSPEND for " << ci->name << " by " << u->GetMask() << " failed"; notice_lang(Config.s_ChanServ, u, CHAN_SUSPEND_FAILED, chan); } return MOD_CONT; @@ -146,14 +146,14 @@ class CommandCSUnSuspend : public Command if (Config.WallForbid) ircdproto->SendGlobops(findbot(Config.s_ChanServ), "\2%s\2 used UNSUSPEND on channel \2%s\2", u->nick.c_str(), ci->name.c_str()); - alog("%s: %s set UNSUSPEND for channel %s", Config.s_ChanServ, u->nick.c_str(), ci->name.c_str()); + Alog() << Config.s_ChanServ << ": " << u->GetMask() << " set UNSUSPEND for channel " << ci->name; notice_lang(Config.s_ChanServ, u, CHAN_UNSUSPEND_SUCCEEDED, chan); FOREACH_MOD(I_OnChanUnsuspend, OnChanUnsuspend(ci)); } else { - alog("%s: Valid UNSUSPEND for %s by %s failed", Config.s_ChanServ, chan, u->nick.c_str()); + Alog() << Config.s_ChanServ << ": Valid UNSUSPEND for " << chan << " by " << u->nick << " failed"; notice_lang(Config.s_ChanServ, u, CHAN_UNSUSPEND_FAILED, chan); } return MOD_CONT; diff --git a/src/core/cs_topic.c b/src/core/cs_topic.c index 8b700a7c5..67546d8e8 100644 --- a/src/core/cs_topic.c +++ b/src/core/cs_topic.c @@ -55,7 +55,7 @@ class CommandCSTopic : public Command c->topic_time = ci->last_topic_time; if (!check_access(u, ci, CA_TOPIC)) - alog("%s: %s!%s@%s changed topic of %s as services admin.", Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, c->name.c_str()); + Alog() << Config.s_NickServ << ": " << u->GetMask() << " changed topic of " << c->name << " as services admin."; if (ircd->join2set && whosends(ci) == findbot(Config.s_ChanServ)) { ircdproto->SendJoin(findbot(Config.s_ChanServ), c->name.c_str(), c->creation_time); diff --git a/src/core/cs_xop.c b/src/core/cs_xop.c index 021d8c3a9..130f62943 100644 --- a/src/core/cs_xop.c +++ b/src/core/cs_xop.c @@ -189,7 +189,9 @@ class XOPBase : public Command access->creator = u->nick; } - alog("%s: %s!%s@%s (level %d) %s access level %d to %s (group %s) on channel %s", Config.s_ChanServ, u->nick.c_str(), u->GetIdent().c_str(), u->host, ulev, change ? "changed" : "set", level, na->nick, nc->display, ci->name.c_str()); + Alog() << Config.s_ChanServ << ": " << u->GetMask() << " (level " << ulev << ") " + << (change ? "changed" : "set") << " access level " << level << " to " << na->nick + << " (group " << nc->display << ") on channel " << ci->name; if (!change) { diff --git a/src/core/db_plain.cpp b/src/core/db_plain.cpp index 564cd9a35..039f19674 100644 --- a/src/core/db_plain.cpp +++ b/src/core/db_plain.cpp @@ -127,7 +127,7 @@ static void ReadDatabase(Module *m = NULL) } catch (const char *err) { - alog("[db_plain}: %s", err); + Alog() << "[db_plain}: " << err; } } else if (na && Type == MD_NA) @@ -143,7 +143,7 @@ static void ReadDatabase(Module *m = NULL) } catch (const char *err) { - alog("[db_plain}: %s", err); + Alog() << "[db_plain}: " << err; } } else if (bi && Type == MD_BI) @@ -159,7 +159,7 @@ static void ReadDatabase(Module *m = NULL) } catch (const char *err) { - alog("[db_plain}: %s", err); + Alog() << "[db_plain}: " << err; } } else if (ci && Type == MD_CH) @@ -175,7 +175,7 @@ static void ReadDatabase(Module *m = NULL) } catch (const char *err) { - alog("[db_plain}: %s", err); + Alog() << "[db_plain}: " << err; } } } @@ -397,8 +397,7 @@ static void LoadNickCore(const std::vector<std::string> ¶ms) nc->memos.memomax = atoi(params[3].c_str()); nc->channelcount = atoi(params[4].c_str()); - if (debug > 1) - alog("[db_plain]: Loaded NickCore %s", nc->display); + Alog(LOG_DEBUG_2) << "[db_plain]: Loaded NickCore " << nc->display; } static void LoadNickAlias(const std::vector<std::string> ¶ms) @@ -406,7 +405,7 @@ static void LoadNickAlias(const std::vector<std::string> ¶ms) NickCore *nc = findcore(params[0].c_str()); if (!nc) { - alog("[db_plain]: Unable to find core %s", params[0].c_str()); + Alog() << "[db_plain]: Unable to find core " << params[0]; return; } @@ -416,8 +415,7 @@ static void LoadNickAlias(const std::vector<std::string> ¶ms) na->last_seen = strtol(params[3].c_str(), NULL, 10); - if (debug > 1) - alog("[db_plain}: Loaded nickalias for %s", na->nick); + Alog(LOG_DEBUG_2) << "[db_plain}: Loaded nickalias for " << na->nick; } static void LoadBotInfo(const std::vector<std::string> ¶ms) @@ -429,8 +427,7 @@ static void LoadBotInfo(const std::vector<std::string> ¶ms) bi->chancount = atol(params[5].c_str()); bi->real = sstrdup(params[6].c_str()); - if (debug > 1) - alog("[db_plain]: Loaded botinfo for %s", bi->nick.c_str()); + Alog(LOG_DEBUG_2) << "[db_plain]: Loaded botinfo for " << bi->nick; } static void LoadChanInfo(const std::vector<std::string> ¶ms) @@ -450,8 +447,7 @@ static void LoadChanInfo(const std::vector<std::string> ¶ms) ci->memos.memomax = atoi(params[4].c_str()); - if (debug > 1) - alog("[db_plain]: loaded channel %s", ci->name.c_str()); + Alog(LOG_DEBUG_2) << "[db_plain]: loaded channel " << ci->name; } static void LoadOperInfo(const std::vector<std::string> ¶ms) @@ -651,7 +647,7 @@ class DBPlain : public Module ci->founder = findcore(params[0].c_str()); if (!ci->founder) { - alog("[db_plain]: Deleting founderless channel %s", ci->name.c_str()); + Alog() << "[db_plain]: Deleting founderless channel " << ci->name; delete ci; ci = NULL; throw "no founder"; diff --git a/src/core/enc_md5.c b/src/core/enc_md5.c index 488fd5754..cc187b3bc 100644 --- a/src/core/enc_md5.c +++ b/src/core/enc_md5.c @@ -356,8 +356,7 @@ class EMD5 : public Module b64_encode(digest, 16, cpass, 1000); buf.append(cpass); - if (debug > 1) - alog("debug: (enc_md5) hashed password %s to %s ", src.c_str(), buf.c_str()); + Alog(LOG_DEBUG_2) << "(enc_md5) hashed password from [" << src << "] to [" << buf << "]"; dest.assign(buf); return EVENT_ALLOW; } diff --git a/src/core/enc_none.c b/src/core/enc_none.c index 2a5237662..8cd375428 100644 --- a/src/core/enc_none.c +++ b/src/core/enc_none.c @@ -30,8 +30,7 @@ class ENone : public Module char cpass[1000]; b64_encode(src.c_str(), src.size(), cpass, 1000); buf.append(cpass); - if (debug > 1) - alog("debug: (enc_none) hashed password from [%s] to [%s]", src.c_str(), buf.c_str()); + Alog(LOG_DEBUG_2) << "(enc_none) hashed password from [" << src << "] to [" << buf << "]"; dest.assign(buf); return EVENT_ALLOW; } diff --git a/src/core/enc_old.c b/src/core/enc_old.c index a04ec75e9..1a4e671f0 100644 --- a/src/core/enc_old.c +++ b/src/core/enc_old.c @@ -361,8 +361,7 @@ class EOld : public Module b64_encode(digest2, 16, cpass, 1000); buf.append(cpass); - if (debug > 1) - alog("debug: (enc_old) hashed password from [%s] to [%s]", src.c_str(), buf.c_str()); + Alog(LOG_DEBUG_2) << "(enc_old) hashed password from [" << src << "] to [" << buf << "]"; dest.assign(buf); return EVENT_ALLOW; } diff --git a/src/core/enc_sha1.c b/src/core/enc_sha1.c index bcf289f0a..95f7083ee 100644 --- a/src/core/enc_sha1.c +++ b/src/core/enc_sha1.c @@ -211,8 +211,7 @@ class ESHA1 : public Module b64_encode(digest, 20, cpass, 1000); |
