aboutsummaryrefslogtreecommitdiffstats
path: root/extcap
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2021-12-04 22:03:31 +0000
committerJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2021-12-06 18:51:42 +0000
commitb6130cd970f15a6cb9ad9b0a80d0d1026cd8244e (patch)
tree1c42599768db2dfe39a834b8dd3dd8f4b73a2a7b /extcap
parent25c7a1abc82d3e9d49883d85e8c5f9e867babf36 (diff)
extcap: Register log handler conditionally
This matches the original implementation and allows displaying logs to the console, including debug information, when running an extcap from the CLI for testing and development purposes. This should make extcap logging bug-for-bug compatible with the behavior before dc7f0b88bb.
Diffstat (limited to 'extcap')
-rw-r--r--extcap/extcap-base.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/extcap/extcap-base.c b/extcap/extcap-base.c
index 358e8cd084..5df8977084 100644
--- a/extcap/extcap-base.c
+++ b/extcap/extcap-base.c
@@ -124,7 +124,7 @@ static void extcap_custom_log(const char *domain, enum ws_log_level level,
void extcap_log_init(const char *progname)
{
- ws_log_init_with_writer(progname, extcap_custom_log, NULL);
+ ws_log_init(progname, NULL);
}
uint8_t extcap_base_parse_options(extcap_parameters * extcap, int result, char * optargument)
@@ -138,6 +138,7 @@ uint8_t extcap_base_parse_options(extcap_parameters * extcap, int result, char *
break;
case EXTCAP_OPT_DEBUG_FILE:
extcap_init_custom_log(optargument);
+ ws_log_set_writer(extcap_custom_log);
break;
case EXTCAP_OPT_LIST_INTERFACES:
extcap->do_list_interfaces = 1;