diff options
author | João Valverde <j@v6e.pt> | 2021-06-19 19:44:58 +0100 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-06-21 16:03:29 +0000 |
commit | 759bb234d0eb4d36947213fca2bc14e386c1cc8f (patch) | |
tree | ec9ba564273b0d0db43bd1d9691feee79d4a41d1 /text2pcap.c | |
parent | c216bb85e75e3db7050f937d6925ba85fb3e6803 (diff) |
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.
Diffstat (limited to 'text2pcap.c')
-rw-r--r-- | text2pcap.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/text2pcap.c b/text2pcap.c index 331ce16203..6c7cbc70b5 100644 --- a/text2pcap.c +++ b/text2pcap.c @@ -103,6 +103,7 @@ #include <cli_main.h> #include <version_info.h> #include <wsutil/inet_addr.h> +#include <wsutil/wslog.h> #ifdef _WIN32 #include <io.h> /* 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 */ |