Skip to content

Commit

Permalink
RSDK-1888 Change log level for cartographer logs (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyrhyde authored Jan 29, 2024
1 parent 82901cf commit c51197c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions viam-cartographer/src/carto_facade/carto_facade.cc
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ extern int viam_carto_lib_init(viam_carto_lib **ppVCL, int minloglevel,
return VIAM_CARTO_OUT_OF_MEMORY;
}
google::InitGoogleLogging("cartographer");
FLAGS_logtostderr = 1;
FLAGS_logtostdout = 1;
FLAGS_minloglevel = minloglevel;
FLAGS_v = verbose;
vcl->minloglevel = minloglevel;
Expand All @@ -844,7 +844,7 @@ extern int viam_carto_lib_terminate(viam_carto_lib **ppVCL) {
return VIAM_CARTO_LIB_INVALID;
}

FLAGS_logtostderr = 0;
FLAGS_logtostdout = 0;
FLAGS_minloglevel = 0;
FLAGS_v = 0;
google::ShutdownGoogleLogging();
Expand Down
8 changes: 4 additions & 4 deletions viam-cartographer/src/carto_facade/carto_facade_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,27 @@ BOOST_AUTO_TEST_SUITE(CartoFacadeCPPAPI);

BOOST_AUTO_TEST_CASE(CartoFacade_lib_init_terminate) {
viam_carto_lib *lib;
BOOST_TEST(FLAGS_logtostderr == 0);
BOOST_TEST(FLAGS_logtostdout == 0);
BOOST_TEST(viam_carto_lib_init(nullptr, 0, 0) == VIAM_CARTO_LIB_INVALID);
BOOST_TEST(viam_carto_lib_terminate(nullptr) == VIAM_CARTO_LIB_INVALID);
viam_carto_lib *invalidlib = nullptr;
BOOST_TEST(viam_carto_lib_terminate(&invalidlib) == VIAM_CARTO_LIB_INVALID);

BOOST_TEST(FLAGS_logtostderr == 0);
BOOST_TEST(FLAGS_logtostdout == 0);
BOOST_TEST(FLAGS_v == 0);
BOOST_TEST(FLAGS_minloglevel == 0);
BOOST_TEST(viam_carto_lib_init(&lib, 2, 3) == VIAM_CARTO_SUCCESS);
BOOST_TEST(lib != nullptr);
BOOST_TEST(lib->minloglevel == 2);
BOOST_TEST(lib->verbose == 3);
// begin global side effects
BOOST_TEST(FLAGS_logtostderr == 1);
BOOST_TEST(FLAGS_logtostdout == 1);
BOOST_TEST(FLAGS_minloglevel == 2);
BOOST_TEST(FLAGS_v == 3);
// end global side effects
BOOST_TEST(viam_carto_lib_terminate(&lib) == VIAM_CARTO_SUCCESS);
BOOST_TEST(lib == nullptr);
BOOST_TEST(FLAGS_logtostderr == 0);
BOOST_TEST(FLAGS_logtostdout == 0);
BOOST_TEST(FLAGS_v == 0);
BOOST_TEST(FLAGS_minloglevel == 0);
}
Expand Down

0 comments on commit c51197c

Please sign in to comment.