64 LL_TraceAndHigher = LL_Trace|LL_Debug|LL_Warn|LL_Error|LL_Fatal,
65 LL_DebugAndHigher = LL_Debug|LL_Warn|LL_Error|LL_Fatal,
66 LL_WarnAndHigher = LL_Warn|LL_Error|LL_Fatal,
67 LL_ErrorAndHigher = LL_Error|LL_Fatal,
68 LL_FatalAndHigher = LL_Fatal,
79 LogLevel
MEZZ_LIB MergeLogLevel(LogLevel First, LogLevel Second);
85 LogLevel
MEZZ_LIB MergeLogLevel(LogLevel First, LogLevel Second, LogLevel Third);
92 LogLevel
MEZZ_LIB MergeLogLevel(LogLevel First, LogLevel Second, LogLevel Third, LogLevel Fourth);
100 LogLevel
MEZZ_LIB MergeLogLevel(LogLevel First, LogLevel Second, LogLevel Third, LogLevel Fourth, LogLevel Fifth);
109 LogLevel
MEZZ_LIB MergeLogLevel(LogLevel First, LogLevel Second, LogLevel Third, LogLevel Fourth, LogLevel Fifth, LogLevel Sixth);
120 LogLevel
MEZZ_LIB MergeLogLevel(LogLevel First, LogLevel Second, LogLevel Third, LogLevel Fourth, LogLevel Fifth, LogLevel Sixth, LogLevel Seventh);
133 LogLevel
MEZZ_LIB MergeLogLevel(LogLevel First, LogLevel Second, LogLevel Third, LogLevel Fourth, LogLevel Fifth, LogLevel Sixth, LogLevel Seventh, LogLevel Eighth);
142 void MEZZ_LIB SetStandardLoggingLevel(LogLevel NewLevel);
146 LogLevel
MEZZ_LIB GetStandardLoggingLevel();
158 template<
class CharType,
class CharTraits = std::
char_traits<CharType> >
159 class LogStream :
public std::basic_ostream<CharType, CharTraits>
164 LogLevel ActivelyLogging;
171 LogStream(std::basic_ostream<CharType, CharTraits>& OutputStream, LogLevel WillLog = LL_Highest)
172 :
std::basic_ostream<CharType, CharTraits>(OutputStream.rdbuf()),
173 ActivelyLogging(WillLog)
179 { ActivelyLogging = NewLevel; }
184 {
return ActivelyLogging; }
190 {
return pf(*
this); }
202 template<
class CharType,
class CharTraits>
206 { OutputStream.clear(std::basic_ios<CharType, CharTraits>::goodbit); }
208 { OutputStream.setstate(std::basic_ios<CharType, CharTraits>::failbit); }
223 template<
class CharType,
class CharTraits>
225 {
return MessageLogLevel(OutputStream, LL_Trace); }
238 template<
class CharType,
class CharTraits>
240 {
return MessageLogLevel(OutputStream, LL_Debug); }
253 template<
class CharType,
class CharTraits>
255 {
return MessageLogLevel(OutputStream, LL_Warn); }
268 template<
class CharType,
class CharTraits>
270 {
return MessageLogLevel(OutputStream, LL_Error); }
283 template<
class CharType,
class CharTraits>
285 {
return MessageLogLevel(OutputStream, LL_Fatal); }
302 template<
class CharType,
class CharTraits>
303 std::basic_ostream<CharType, CharTraits>& MessageLogLevel(std::basic_ostream<CharType, CharTraits>& OutputStream, LogLevel CurrentLevel)
305 if(CurrentLevel & GetStandardLoggingLevel())
306 { OutputStream.clear(std::basic_ios<CharType, CharTraits>::goodbit); }
308 { OutputStream.setstate(std::basic_ios<CharType, CharTraits>::failbit); }
322 template<
class CharType,
class CharTraits>
323 std::basic_ostream<CharType, CharTraits>& LogTrace(std::basic_ostream<CharType, CharTraits>& OutputStream)
324 {
return MessageLogLevel(OutputStream, LL_Trace); }
336 template<
class CharType,
class CharTraits>
337 std::basic_ostream<CharType, CharTraits>& LogDebug(std::basic_ostream<CharType, CharTraits>& OutputStream)
338 {
return MessageLogLevel(OutputStream, LL_Debug); }
350 template<
class CharType,
class CharTraits>
351 std::basic_ostream<CharType, CharTraits>& LogWarn(std::basic_ostream<CharType, CharTraits>& OutputStream)
352 {
return MessageLogLevel(OutputStream, LL_Warn); }
364 template<
class CharType,
class CharTraits>
365 std::basic_ostream<CharType, CharTraits>& LogError(std::basic_ostream<CharType, CharTraits>& OutputStream)
366 {
return MessageLogLevel(OutputStream, LL_Error); }
378 template<
class CharType,
class CharTraits>
379 std::basic_ostream<CharType, CharTraits>& LogFatal(std::basic_ostream<CharType, CharTraits>& OutputStream)
380 {
return MessageLogLevel(OutputStream, LL_Fatal); }
A stream that tracks its own level of logging.
LogStream(std::basic_ostream< CharType, CharTraits > &OutputStream, LogLevel WillLog=LL_Highest)
Buffer Stealing Constructor.
void SetLoggingLevel(LogLevel NewLevel)
Change the level of what this Stream is logging.
LogLevel GetLoggingLevel()
What will currently be logged?