From ac4513a5b84017e5e95fc4b84e3e8444fd2c8494 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 31 Mar 2018 12:52:47 +0200 Subject: Logging: add ability to exclude categories. --- source/creator/creator_args.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index 17fa18916fd..3be16ba650b 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -761,6 +761,7 @@ static int arg_handle_log_file_set(int argc, const char **argv, void *UNUSED(dat static const char arg_handle_log_set_doc[] = "\n\tEnable logging categories, taking a single comma separated argument.\n" "\tMultiple categories can be matched using a '.*' suffix, so '--log \"wm.*\"' logs every kind of window-manager message.\n" +"\tUse \"^\" prefix to ignore, so '--log \"*,^wm.operator.*\"' logs all except for 'wm.operators.*'\n" "\tUse \"*\" to log everything." ; static int arg_handle_log_set(int argc, const char **argv, void *UNUSED(data)) @@ -772,7 +773,12 @@ static int arg_handle_log_set(int argc, const char **argv, void *UNUSED(data)) const char *str_step_end = strchr(str_step, ','); int str_step_len = str_step_end ? (str_step_end - str_step) : strlen(str_step); - CLG_type_filter(str_step, str_step_len); + if (str_step[0] == '^') { + CLG_type_filter_exclude(str_step + 1, str_step_len - 1); + } + else { + CLG_type_filter_include(str_step, str_step_len); + } if (str_step_end) { /* typically only be one, but don't fail on multiple.*/ -- cgit v1.2.3