@@ -336,11 +336,9 @@ void LogConfiguration::disable_logging() {
336336 notify_update_listeners ();
337337}
338338
339- void LogConfiguration::configure_stdout (LogLevelType level, int exact_match, ... ) {
339+ LogSelectionList LogConfiguration::create_selection_list (LogLevelType level, int exact_match, va_list ap ) {
340340 size_t i;
341- va_list ap;
342341 LogTagType tags[LogTag::MaxTags];
343- va_start (ap, exact_match);
344342 for (i = 0 ; i < LogTag::MaxTags; i++) {
345343 LogTagType tag = static_cast <LogTagType>(va_arg (ap, int ));
346344 tags[i] = tag;
@@ -351,12 +349,32 @@ void LogConfiguration::configure_stdout(LogLevelType level, int exact_match, ...
351349 }
352350 assert (i < LogTag::MaxTags || static_cast <LogTagType>(va_arg (ap, int )) == LogTag::__NO_TAG,
353351 " Too many tags specified! Can only have up to %zu tags in a tag set." , LogTag::MaxTags);
354- va_end (ap);
355352
356353 LogSelection selection (tags, !exact_match, level);
357354 assert (selection.tag_sets_selected () > 0 ,
358- " configure_stdout() called with invalid/non-existing log selection" );
359- LogSelectionList list (selection);
355+ " create_selection_list() called with invalid/non-existing log selection" );
356+ return LogSelectionList (selection);
357+ }
358+
359+ void LogConfiguration::disable_tags (int exact_match, ...) {
360+ va_list ap;
361+ va_start (ap, exact_match);
362+ LogSelectionList list = create_selection_list (LogLevel::Off, exact_match, ap);
363+ va_end (ap);
364+
365+ // Apply configuration to all outputs, with the same decorators as before.
366+ ConfigurationLock cl;
367+ for (size_t i = 0 ; i < _n_outputs; i++) {
368+ configure_output (i, list, _outputs[i]->decorators ());
369+ }
370+ notify_update_listeners ();
371+ }
372+
373+ void LogConfiguration::configure_stdout (LogLevelType level, int exact_match, ...) {
374+ va_list ap;
375+ va_start (ap, exact_match);
376+ LogSelectionList list = create_selection_list (level, exact_match, ap);
377+ va_end (ap);
360378
361379 // Apply configuration to stdout (output #0), with the same decorators as before.
362380 ConfigurationLock cl;
0 commit comments