From ec05778d5718a7912e506764d443a78d6a6179e3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 5 Nov 2012 22:41:51 +0000 Subject: Converted tabs to spaces with tabconv. --- src/stable/logger.h | 154 ++++++++++++++++++++++++++-------------------------- 1 file changed, 77 insertions(+), 77 deletions(-) (limited to 'src/stable/logger.h') diff --git a/src/stable/logger.h b/src/stable/logger.h index 198ffa2..bcc5a83 100644 --- a/src/stable/logger.h +++ b/src/stable/logger.h @@ -13,82 +13,82 @@ namespace Bu { - /** - * Simple logging facility. All output goes straight to stdout, unlike the - * old multi-log system. Generally we expect any program complex enough to - * want to use this will have other facilities for processing the logging - * output, but if we need it we can add other output methods. - * - * Currently implemented as a singleton to avoid clutter with globals, you - * generally never want to use the logging system directly, it's annoying. - * Instead use the handy macros lineLog, setLogMask, setLogFormat, and - * setLogLevel. They do all the real work for you. - * - * In the log format, you can specify extra information that will be written - * to the log with every message, and extras in printf style. Use %X flags - * where X is one of the following: - * - L - Logging level of the log message (not the current mask) - * - y - Full year - * - m - Month - * - d - Day of month - * - h - Hour (24-hour format) - * - M - Minutes - * - s - Seconds - * - f - Source file - * - l - Line number - * - F - function name - * - t - Text of message (usually important) - * - * You can include anything extra that you would like, a newline will always - * be added automatically, so no need to worry about that. You can also - * include any extra printf style formatting that you would like, for - * example: "%h:%02M:%02s" for the time 4:02:09 instead of 4:2:9. - * - * It's generally handy to create an enum of values you use as levels during - * program execution (such as error, warning, info, debug, etc). These - * levels should be treated as bitflags, and the most desirable messages, - * i.e. serious errors and the like should be low order (0x01), and the much - * less desirable messages, like debugging info, should be higher order - * (0xF0). During operation you can then set either an explicit mask, - * selecting just the levels that you would like to see printed, or set the - * mask using the setLevel helper function, which simulates verbosity - * levels, enabling every flag lower order than the highest order set bit - * passed. I.E. if you had the following enumerated levels: - * - *@code - enum { - logError = 0x01, - logWarning = 0x02, - logInfo = 0x04, - logDebug = 0x08 - }; - @endcode - * And you set the mask with setMask( logInfo ) the only messages you would - * see are the ones catagorized logInfo. However, if you used - * setLevel( logInfo ) then you would see logInfo, logWarning, and logError - * type messages, since they are lower order. - */ - class Logger : public Bu::Singleton - { - friend class Bu::Singleton; - private: - Logger(); - virtual ~Logger(); + /** + * Simple logging facility. All output goes straight to stdout, unlike the + * old multi-log system. Generally we expect any program complex enough to + * want to use this will have other facilities for processing the logging + * output, but if we need it we can add other output methods. + * + * Currently implemented as a singleton to avoid clutter with globals, you + * generally never want to use the logging system directly, it's annoying. + * Instead use the handy macros lineLog, setLogMask, setLogFormat, and + * setLogLevel. They do all the real work for you. + * + * In the log format, you can specify extra information that will be written + * to the log with every message, and extras in printf style. Use %X flags + * where X is one of the following: + * - L - Logging level of the log message (not the current mask) + * - y - Full year + * - m - Month + * - d - Day of month + * - h - Hour (24-hour format) + * - M - Minutes + * - s - Seconds + * - f - Source file + * - l - Line number + * - F - function name + * - t - Text of message (usually important) + * + * You can include anything extra that you would like, a newline will always + * be added automatically, so no need to worry about that. You can also + * include any extra printf style formatting that you would like, for + * example: "%h:%02M:%02s" for the time 4:02:09 instead of 4:2:9. + * + * It's generally handy to create an enum of values you use as levels during + * program execution (such as error, warning, info, debug, etc). These + * levels should be treated as bitflags, and the most desirable messages, + * i.e. serious errors and the like should be low order (0x01), and the much + * less desirable messages, like debugging info, should be higher order + * (0xF0). During operation you can then set either an explicit mask, + * selecting just the levels that you would like to see printed, or set the + * mask using the setLevel helper function, which simulates verbosity + * levels, enabling every flag lower order than the highest order set bit + * passed. I.E. if you had the following enumerated levels: + * + *@code + enum { + logError = 0x01, + logWarning = 0x02, + logInfo = 0x04, + logDebug = 0x08 + }; + @endcode + * And you set the mask with setMask( logInfo ) the only messages you would + * see are the ones catagorized logInfo. However, if you used + * setLevel( logInfo ) then you would see logInfo, logWarning, and logError + * type messages, since they are lower order. + */ + class Logger : public Bu::Singleton + { + friend class Bu::Singleton; + private: + Logger(); + virtual ~Logger(); - public: - void log( uint32_t nLevel, const char *sFile, const char *sFunction, int nLine, const char *sFormat, ...); + public: + void log( uint32_t nLevel, const char *sFile, const char *sFunction, int nLine, const char *sFormat, ...); - void setFormat( const Bu::String &str ); - void setMask( uint32_t n ); - void setLevel( uint32_t n ); - uint32_t getMask(); + void setFormat( const Bu::String &str ); + void setMask( uint32_t n ); + void setLevel( uint32_t n ); + uint32_t getMask(); - void hexDump( uint32_t nLevel, const char *sFile, const char *sFunction, int nLine, const void *pData, long nDataLen, const char *lpName ); + void hexDump( uint32_t nLevel, const char *sFile, const char *sFunction, int nLine, const void *pData, long nDataLen, const char *lpName ); - private: - Bu::String sLogFormat; - uint32_t nLevelMask; - }; + private: + Bu::String sLogFormat; + uint32_t nLevelMask; + }; } /** @@ -97,29 +97,29 @@ namespace Bu * file, line number, and function. */ #define lineLog( nLevel, sFrmt, ...) \ - Bu::Logger::getInstance().log( nLevel, __FILE__, __PRETTY_FUNCTION__, __LINE__, sFrmt, ##__VA_ARGS__ ) + Bu::Logger::getInstance().log( nLevel, __FILE__, __PRETTY_FUNCTION__, __LINE__, sFrmt, ##__VA_ARGS__ ) #define logHexDump( nLevel, pData, iSize, sName ) \ - Bu::Logger::getInstance().hexDump( nLevel, __FILE__, __PRETTY_FUNCTION__, __LINE__, pData, iSize, sName ) + Bu::Logger::getInstance().hexDump( nLevel, __FILE__, __PRETTY_FUNCTION__, __LINE__, pData, iSize, sName ) /** * Set the Bu::Logger logging mask directly. See Bu::Logger::setMask for * details. */ #define setLogMask( nLevel ) \ - Bu::Logger::getInstance().setMask( nLevel ) + Bu::Logger::getInstance().setMask( nLevel ) /** * Set the Bu::Logger format. See Bu::Logger::setFormat for details. */ #define setLogFormat( sFrmt ) \ - Bu::Logger::getInstance().setFormat( sFrmt ) + Bu::Logger::getInstance().setFormat( sFrmt ) /** * Set the Bu::Logger logging mask simulating levels. See Bu::Logger::setLevel * for details. */ #define setLogLevel( nLevel ) \ - Bu::Logger::getInstance().setLevel( nLevel ) + Bu::Logger::getInstance().setLevel( nLevel ) #endif -- cgit v1.2.3