Skip to content
Snippets Groups Projects
Commit 542ced54 authored by Max Lyon's avatar Max Lyon
Browse files

add helper struct to modify global output_level within a scope

parent 0b2ad068
Branches
Tags
No related merge requests found
......@@ -80,6 +80,14 @@ private:
Config& operator=(const Config&);
};
/// Helper struct to locally set the global output level and reset it when leaving the scope
struct ScopedOutputLevel
{
ScopedOutputLevel(int level) : lvl_bfre_(Config::query().output_level) { Config::modify().output_level = level; }
~ScopedOutputLevel() { Config::modify().output_level = lvl_bfre_; }
int lvl_bfre_;
};
}; // namespace Debug
#endif // DEB_ON
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment