From 5a662ba3fb93d6abef23fe665807ad5ec09b1103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Fri, 11 Jun 2021 13:39:16 +0100 Subject: wslog: Add support for domain filtering A domain filter can be given in the environment variable 'WS_LOG_DOMAINS' or in a command-line options "--log-domains". The filter is specified as a comma separated case insensitive list, for example: ./tshark --log-domains=main,capture Domain data type switches from an enum to a string. There is no constaint on adding new domains, neither in code or at runtime. The string format is arbitrary, only positive matches will produce output. --- dumpcap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'dumpcap.c') diff --git a/dumpcap.c b/dumpcap.c index 3391e2697c..b9cffabdba 100644 --- a/dumpcap.c +++ b/dumpcap.c @@ -329,7 +329,7 @@ static gboolean need_timeout_workaround; static void dumpcap_log_writer(const char *format, va_list ap, const char *prefix, - enum ws_log_domain domain, + const char *domain, enum ws_log_level level, void *user_data); @@ -4859,6 +4859,7 @@ main(int argc, char *argv[]) cmdarg_err("Invalid log level \"%s\"", opt_err_val); exit (1); } + ws_log_set_domain_filter_args(&argc, argv); #ifdef _WIN32 create_app_running_mutex(); @@ -5572,7 +5573,7 @@ main(int argc, char *argv[]) static void dumpcap_log_writer(const char *format, va_list ap, const char *prefix, - enum ws_log_domain domain _U_, + const char *domain _U_, enum ws_log_level level _U_, void *user_data _U_) { -- cgit v1.2.3