diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2021-06-11 13:39:16 +0100 |
---|---|---|
committer | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2021-06-14 13:13:12 +0100 |
commit | 5a662ba3fb93d6abef23fe665807ad5ec09b1103 (patch) | |
tree | fe4072b9353a33bb1f57302e22b77dbd5f905e17 /dumpcap.c | |
parent | 82739fc4f55f51b1d5dd79078bd507837c27dedf (diff) |
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.
Diffstat (limited to 'dumpcap.c')
-rw-r--r-- | dumpcap.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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_) { |