From 759bb234d0eb4d36947213fca2bc14e386c1cc8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Sat, 19 Jun 2021 19:44:58 +0100 Subject: wslog: Check if we are initialized and add missing inits Instead of receiving the program name from GLib, pass it explicitly to ws_log_init() instead and use that to initialize the GLib program name. ws_log_parse_args() will now exit the program when it encounters an argument error if exit_failure >= 0. --- text2pcap.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'text2pcap.c') diff --git a/text2pcap.c b/text2pcap.c index 331ce16203..6c7cbc70b5 100644 --- a/text2pcap.c +++ b/text2pcap.c @@ -103,6 +103,7 @@ #include #include #include +#include #ifdef _WIN32 #include /* for _setmode */ @@ -1864,6 +1865,9 @@ main(int argc, char *argv[]) { int ret = EXIT_SUCCESS; + /* Initialize log handler early so we can have proper logging during startup. */ + ws_log_init("text2pcap", NULL); + #ifdef _WIN32 create_app_running_mutex(); #endif /* _WIN32 */ -- cgit v1.2.3