summaryrefslogtreecommitdiff
path: root/lib/common/Logging.h
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2018-02-20 21:50:22 -0500
committerReinhard Tartler <siretart@tauware.de>2018-02-20 21:50:22 -0500
commitf6d7cfd710de1bf9d4f6eabab45570bc91941ee1 (patch)
tree6aed4f8606e47c6ef21c5b1d8bbf7cafa694af6e /lib/common/Logging.h
parentc81b92946b58b90fe9679a476338e2d2dec8df67 (diff)
parentf28f88e5e72ba1499409047a9d6985eb312c0232 (diff)
Merge branch 'upstream'
Diffstat (limited to 'lib/common/Logging.h')
-rw-r--r--lib/common/Logging.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/common/Logging.h b/lib/common/Logging.h
index 01358617..3dc3e69c 100644
--- a/lib/common/Logging.h
+++ b/lib/common/Logging.h
@@ -295,6 +295,32 @@ class Console : public Logger
static void SetShowTimeMicros(bool enabled);
static void SetShowPID(bool enabled);
static bool GetShowTag() { return sShowTag; }
+
+ class SettingsGuard
+ {
+ private:
+ bool mShowTag;
+ bool mShowTime;
+ bool mShowTimeMicros;
+ bool mShowPID;
+ std::string mTag;
+ public:
+ SettingsGuard()
+ : mShowTag(Console::sShowTag),
+ mShowTime(Console::sShowTime),
+ mShowTimeMicros(Console::sShowTimeMicros),
+ mShowPID(Console::sShowPID),
+ mTag(Console::sTag)
+ { }
+ ~SettingsGuard()
+ {
+ Console::SetShowTag(mShowTag);
+ Console::SetShowTime(mShowTime);
+ Console::SetShowTimeMicros(mShowTimeMicros);
+ Console::SetShowPID(mShowPID);
+ Console::sTag = mTag;
+ }
+ };
};
// --------------------------------------------------------------------------