Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CoMISo
Base
Commits
542ced54
Commit
542ced54
authored
Oct 15, 2020
by
Max Lyon
Browse files
add helper struct to modify global output_level within a scope
parent
0b2ad068
Changes
1
Hide whitespace changes
Inline
Side-by-side
Debug/DebConfig.hh
View file @
542ced54
...
...
@@ -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
...
...
Martin Marinov
@mmarinov
mentioned in commit
feebe42b
·
Feb 04, 2021
mentioned in commit
feebe42b
mentioned in commit feebe42b4748a1b643afebaa41e731d346267e4e
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment