From aa4b3e256377030d291fc2d5f4db94985ce04395 Mon Sep 17 00:00:00 2001 From: DukePyrolator Date: Sun, 31 Jan 2010 06:15:29 +0000 Subject: 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 --- include/services.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'include/services.h') diff --git a/include/services.h b/include/services.h index eb9fdc34d..7325685f5 100644 --- a/include/services.h +++ b/include/services.h @@ -1162,6 +1162,32 @@ struct Uplink { } }; +enum LogLevel +{ + LOG_NORMAL, + LOG_DEBUG, + LOG_DEBUG_2, + LOG_DEBUG_3, + LOG_DEBUG_4 +}; + +class CoreExport Alog +{ + private: + std::stringstream buf; + bool logit; + public: + Alog(LogLevel val = LOG_NORMAL); + ~Alog(); + template Alog& operator<<(T val) + { + if (logit) + buf << val; + return *this; + } +}; + + class CoreExport Anope { public: -- cgit