Skip to content

Commit

Permalink
Adopting utl::log()
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-C committed Jan 17, 2025
1 parent 0861ed9 commit bb211ac
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .pkg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[utl]
url=git@github.com:motis-project/utl.git
branch=master
commit=368fdcb8326ced5bb151b60c09a07c2e5f09bf55
commit=69e700e03ae3d385304d754cf57877528bc591ef
[miniz]
url=git@github.com:motis-project/miniz.git
branch=master
Expand Down
6 changes: 3 additions & 3 deletions include/nigiri/footpath.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ struct footpath {
kDurationBits,
"station index overflow");
if (duration > kMaxDuration) {
[[unlikely]] nigiri::log(log_lvl::error, "footpath",
"footpath overflow: {} > {} adjusted to {}",
duration, kMaxDuration, this->duration());
[[unlikely]] utl::error("footpath",
"footpath overflow: {} > {} adjusted to {}",
duration, kMaxDuration, this->duration());
}
}

Expand Down
4 changes: 2 additions & 2 deletions include/nigiri/timetable.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ struct timetable {
transfer_time_.emplace_back(l.transfer_time_);
parents_.emplace_back(l.parent_);
} else {
log(log_lvl::error, "timetable.register_location",
"duplicate station {}", l.id_);
utl::error("timetable.register_location", "duplicate station {}",
l.id_);
}

assert(names_.size() == next_idx + 1);
Expand Down
8 changes: 3 additions & 5 deletions src/abi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ nigiri_timetable_t* nigiri_load_from_dir(nigiri::loader::dir const& d,
auto const c =
utl::find_if(loaders, [&](auto&& l) { return l->applicable(d); });
utl::verify(c != end(loaders), "no loader applicable to the given file(s)");
nigiri::log(nigiri::log_lvl::info, "main",
utl::info("main",
"loading nigiri timetable with configuration {}", (*c)->name());

auto t = new nigiri_timetable_t;
Expand Down Expand Up @@ -267,11 +267,9 @@ void nigiri_update_with_rt_from_buf(const nigiri_timetable_t* t,
try {
nigiri::rt::gtfsrt_update_buf(*t->tt, *t->rtt, src, tag, protobuf);
} catch (std::exception const& e) {
nigiri::log(nigiri::log_lvl::error, "main",
"GTFS-RT update error (tag={}) {}", tag, e.what());
utl::error("main", "GTFS-RT update error (tag={}) {}", tag, e.what());
} catch (...) {
nigiri::log(nigiri::log_lvl::error, "main",
"Unknown GTFS-RT update error (tag={})", tag);
utl::error("main", "Unknown GTFS-RT update error (tag={})", tag);
}
t->rtt->reset_change_callback();
}
Expand Down

0 comments on commit bb211ac

Please sign in to comment.