Changeset 2279 for box/trunk/lib/common/Logging.h
- Timestamp:
- 13/09/2008 16:11:35 (4 years ago)
- File:
-
- 1 edited
-
box/trunk/lib/common/Logging.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/common/Logging.h
r2208 r2279 144 144 { 145 145 private: 146 static bool sShowTag; 146 147 static bool sShowTime; 147 148 static bool sShowTimeMicros; 148 static bool sShow Tag;149 static bool sShowPID; 149 150 static std::string sTag; 150 static bool sShowPID;151 151 152 152 public: … … 154 154 int line, std::string& rMessage); 155 155 virtual const char* GetType() { return "Console"; } 156 virtual void SetProgramName(const std::string& rProgramName) { }157 158 static void Set Tag(const std::string& rTag);156 virtual void SetProgramName(const std::string& rProgramName); 157 158 static void SetShowTag(bool enabled); 159 159 static void SetShowTime(bool enabled); 160 160 static void SetShowTimeMicros(bool enabled); … … 207 207 static Log::Level sGlobalLevel; 208 208 static Logging sGlobalLogging; 209 static std::string sProgramName; 209 210 210 211 public: … … 231 232 } 232 233 static void SetProgramName(const std::string& rProgramName); 234 static std::string GetProgramName() { return sProgramName; } 233 235 234 236 class Guard … … 248 250 } 249 251 }; 252 253 class Tagger 254 { 255 private: 256 std::string mOldTag; 257 258 public: 259 Tagger(const std::string& rTempTag) 260 { 261 mOldTag = Logging::GetProgramName(); 262 Logging::SetProgramName(mOldTag + " " + rTempTag); 263 } 264 ~Tagger() 265 { 266 Logging::SetProgramName(mOldTag); 267 } 268 }; 250 269 }; 251 270
Note: See TracChangeset
for help on using the changeset viewer.
