Skip to content

Commit

Permalink
Set any log level with --log-level (stella-cv#133) (stella-cv#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymd-stella authored Jul 9, 2023
1 parent 988b13f commit 18b976d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/run_slam.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ int main(int argc, char* argv[]) {
auto vocab_file_path = op.add<popl::Value<std::string>>("v", "vocab", "vocabulary file path");
auto setting_file_path = op.add<popl::Value<std::string>>("c", "config", "setting file path");
auto mask_img_path = op.add<popl::Value<std::string>>("", "mask", "mask image path", "");
auto debug_mode = op.add<popl::Switch>("", "debug", "debug mode");
auto log_level = op.add<popl::Value<std::string>>("", "log-level", "log level", "info");
auto eval_log = op.add<popl::Switch>("", "eval-log", "store trajectory and tracking times for evaluation");
auto map_db_path_in = op.add<popl::Value<std::string>>("i", "map-db-in", "load a map from this path", "");
auto map_db_path_out = op.add<popl::Value<std::string>>("o", "map-db-out", "store a map database at this path after slam", "");
Expand Down Expand Up @@ -157,12 +157,7 @@ int main(int argc, char* argv[]) {

// setup logger
spdlog::set_pattern("[%Y-%m-%d %H:%M:%S.%e] %^[%L] %v%$");
if (debug_mode->is_set()) {
spdlog::set_level(spdlog::level::debug);
}
else {
spdlog::set_level(spdlog::level::info);
}
spdlog::set_level(spdlog::level::from_str(log_level->value()));

// load configuration
std::shared_ptr<stella_vslam::config> cfg;
Expand Down

0 comments on commit 18b976d

Please sign in to comment.