mirror of https://gerrit.osmocom.org/simtrace2
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
This commit is contained in:
parent
5b7a608277
commit
651050922a
|
@ -39,6 +39,8 @@
|
||||||
|
|
||||||
#include <osmocom/core/utils.h>
|
#include <osmocom/core/utils.h>
|
||||||
#include <osmocom/core/msgb.h>
|
#include <osmocom/core/msgb.h>
|
||||||
|
#include <osmocom/core/logging.h>
|
||||||
|
#include <osmocom/core/application.h>
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* Incoming Messages
|
* Incoming Messages
|
||||||
|
@ -213,6 +215,7 @@ static int do_command(int argc, char **argv)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct log_info log_info = {};
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
@ -265,6 +268,8 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
transp->udp_fd = -1;
|
transp->udp_fd = -1;
|
||||||
|
|
||||||
|
osmo_init_logging2(NULL, &log_info);
|
||||||
|
|
||||||
rc = osmo_libusb_init(NULL);
|
rc = osmo_libusb_init(NULL);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
fprintf(stderr, "libusb initialization failed\n");
|
fprintf(stderr, "libusb initialization failed\n");
|
||||||
|
|
Loading…
Reference in New Issue