/TGame/TUtil/Log/LogUtil.h
http://awoe.googlecode.com/ · C Header · 61 lines · 41 code · 17 blank · 3 comment · 0 complexity · f43a112803fa4c0a77b67e78cd6fb330 MD5 · raw file
- #ifndef __LOG_UTILES___
- #define __LOG_UTILES___
-
- #include <string>
-
-
- namespace woe
- {
- #ifdef UNICODE
-
- #define TS(str) L##str
- #else
-
- #define TS(str) str
- #endif
-
- enum
- {
- LGT_Simple,
- LGT_ThreadSafe,
- LGT_Async,
- };
-
-
- class TimeStamp
- {
- public:
- TimeStamp();
- TimeStamp(unsigned int seconds, unsigned int microSeconds = 0);
-
- inline int getSeconds() const { return _seconds; };
-
- inline int getMilliSeconds() const { return _microSeconds / 1000; };
-
- inline int getMicroSeconds() const { return _microSeconds; };
-
- void format(std::string& fmt)const;
-
- static inline const TimeStamp& getStartTime() { return _startStamp; };
- protected:
- static TimeStamp _startStamp;
-
- int _seconds;
- int _microSeconds;
- };
-
- class LogLevelUtil
- {
- public:
- //
- // get log level name
- //
- static const std::string& getLogLevelName(short lvl);
- static short getLogLevel(const std::string& lvlName);
- protected:
- static std::vector<std::string> __log_level_names;
- };
- }
-
- #endif