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/process.c | |
| 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/process.c')
| -rw-r--r-- | src/process.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/src/process.c b/src/process.c index 3165949da..2c85e1644 100644 --- a/src/process.c +++ b/src/process.c @@ -83,8 +83,7 @@ void add_ignore(const char *nick, time_t delta) if (ignore) ignore->prev = ign; ignore = ign; - if (debug) - alog("debug: Added new ignore entry for %s", mask); + Alog(LOG_DEBUG) << "Added new ignore entry for " << mask; } } @@ -139,9 +138,9 @@ IgnoreData *get_ignore(const char *nick) break; } /* Check whether the entry has timed out */ - if (ign && ign->time != 0 && ign->time <= now) { - if (debug) - alog("debug: Expiring ignore entry %s", ign->mask); + if (ign && ign->time != 0 && ign->time <= now) + { + Alog(LOG_DEBUG) << "Expiring ignore entry " << ign->mask; if (ign->prev) ign->prev->next = ign->next; else if (ignore == ign) @@ -153,7 +152,7 @@ IgnoreData *get_ignore(const char *nick) ign = NULL; } if (ign && debug) - alog("debug: Found ignore entry (%s) for %s", ign->mask, nick); + Alog(LOG_DEBUG) << "Found ignore entry (" << ign->mask << ") for " << nick; return ign; } @@ -197,8 +196,7 @@ int delete_ignore(const char *nick) /* No matching ignore found. */ if (!ign) return 0; - if (debug) - alog("Deleting ignore entry %s", ign->mask); + Alog(LOG_DEBUG) << "Deleting ignore entry " << ign->mask; /* Delete the entry and all references to it. */ if (ign->prev) ign->prev->next = ign->next; @@ -228,8 +226,7 @@ int clear_ignores() return 0; for (ign = ignore; ign; ign = next) { next = ign->next; - if (debug) - alog("Deleting ignore entry %s", ign->mask); + Alog(LOG_DEBUG) << "Deleting ignore entry " << ign->mask; delete [] ign->mask; delete ign; i++; @@ -302,9 +299,7 @@ void process() *cmd = '\0'; /* If debugging, log the buffer */ - if (debug) { - alog("debug: Received: %s", inbuf); - } + Alog(LOG_DEBUG) << "Received: " << inbuf; /* First make a copy of the buffer so we have the original in case we * crash - in that case, we want to know what we crashed on. */ @@ -338,17 +333,17 @@ void process() if (protocoldebug) { if (*source) - alog("debug: Source %s", source); + Alog() << "Source " << source; if (*cmd) - alog("debug: Token %s", cmd); + Alog() << "Token " << cmd; if (ac) { int i; for (i = 0; i < ac; i++) - alog("debug: av[%d] = %s", i, av[i]); + Alog() << "av[" << i << "] = " << av[i]; } else - alog("debug: av[0] = NULL"); + Alog() << "av[0] = NULL"; } /* Do something with the message. */ @@ -365,8 +360,7 @@ void process() } } } else { - if (debug) - alog("debug: unknown message from server (%s)", inbuf); + Alog(LOG_DEBUG) << "unknown message from server (" << inbuf << ")"; } /* Free argument list we created */ |
