From 651050922a57a341560cb3c26f59009bd731eb32 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 6 Oct 2021 21:10:02 +0200 Subject: [PATCH] simtrace2-tool: Initialize logging to avoid error on first log output This avoids ERROR: osmo_log_info == NULL! You must call log_init() before using logging in log_check_level() Change-Id: Id355ef33e10164f8e8eb40c2fd0b606bc8e9b6f7 --- host/src/simtrace2-tool.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/host/src/simtrace2-tool.c b/host/src/simtrace2-tool.c index f1423b07..97d77060 100644 --- a/host/src/simtrace2-tool.c +++ b/host/src/simtrace2-tool.c @@ -39,6 +39,8 @@ #include #include +#include +#include /*********************************************************************** * Incoming Messages @@ -213,6 +215,7 @@ static int do_command(int argc, char **argv) return rc; } +static struct log_info log_info = {}; int main(int argc, char **argv) { @@ -265,6 +268,8 @@ int main(int argc, char **argv) transp->udp_fd = -1; + osmo_init_logging2(NULL, &log_info); + rc = osmo_libusb_init(NULL); if (rc < 0) { fprintf(stderr, "libusb initialization failed\n");