summaryrefslogtreecommitdiff
path: root/lib/common/Logging.h
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-02-08 12:20:16 +0000
committerChris Wilson <chris+github@qwirx.com>2014-02-08 12:20:16 +0000
commit046a872a59fc1d7bb681994bd79c60392b733f77 (patch)
treea3d765ad498d9aeaed048314a8d460a0d331efd0 /lib/common/Logging.h
parenta559eddb48b19f0d636ce9722d318858997f5e5c (diff)
Add a logging guard that temporarily enables tagging on the console.
This is useful for disambiguating messages coming from different parts of the application when looking at console output.
Diffstat (limited to 'lib/common/Logging.h')
-rw-r--r--lib/common/Logging.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/common/Logging.h b/lib/common/Logging.h
index f9cc679a..0a708caf 100644
--- a/lib/common/Logging.h
+++ b/lib/common/Logging.h
@@ -363,6 +363,23 @@ class Logging
}
};
+ class ShowTagOnConsole
+ {
+ private:
+ bool mOldShowTag;
+
+ public:
+ ShowTagOnConsole()
+ : mOldShowTag(Console::GetShowTag())
+ {
+ Console::SetShowTag(true);
+ }
+ ~ShowTagOnConsole()
+ {
+ Console::SetShowTag(mOldShowTag);
+ }
+ };
+
class Tagger
{
private: