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 /include/services.h | |
| 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 'include/services.h')
| -rw-r--r-- | include/services.h | 26 |
1 files changed, 26 insertions, 0 deletions
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<typename T> Alog& operator<<(T val) + { + if (logit) + buf << val; + return *this; + } +}; + + class CoreExport Anope { public: |
