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 20, 2025
1 parent 0861ed9 commit 009154b
Show file tree
Hide file tree
Showing 34 changed files with 82 additions and 164 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]
[email protected]:motis-project/utl.git
branch=master
commit=368fdcb8326ced5bb151b60c09a07c2e5f09bf55
commit=492a0e3ae2d69d13b43141fff5d12b767d6155df
[miniz]
[email protected]:motis-project/miniz.git
branch=master
Expand Down
48 changes: 24 additions & 24 deletions .pkg.lock
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
8143833587396253561
cista fabfc0cbcf07343a2e0c2def3009555b22f0ae46
PEGTL 1c1aa6e650e4d26f10fa398f148ec0cdc5f0808d
res b759b93316afeb529b6cb5b2548b24c41e382fb0
date ce88cc33b5551f66655614eeebb7c5b7189025fb
googletest 7b64fca6ea0833628d6f86255a81424365f7cc0c
fmt dc10f83be70ac2873d5f8d1ce317596f1fd318a2
utl 368fdcb8326ced5bb151b60c09a07c2e5f09bf55
oh d21c30f40e52a83d6dc09bcffd0067598b5ec069
zlib-ng 68ab3e2d80253ec5dc3c83691d9ff70477b32cd3
boost 73549ebca677fe6214202a1ab580362b4f80e653
doctest 70e8f76437b76dd5e9c0a2eb9b907df190ab71a0
geo cee17208dba98f5f3ddaf78d0bfff9c083557ba3
miniz 1edbdece9d71dc65c6ff405572ee37cbdcef7af4
libressl 24acd9e710fbe842e863572da9d738715fbc74b8
curl 39c8a51e8ee0ab7ea712886df79c068405a2e008
json 410c74782230daaa15054d6ee0975c0607091cb3
opentelemetry-proto 1624689398a3226c45994d70cb544a1e781dc032
abseil-cpp ba5240842d352b4b67a32092453a2fe5fe53a62e
protobuf df2dd518c68b882c9dce5346393f8c388108e733
opentelemetry-cpp 60770dc9dc63e3543fc87d605b2e88fd53d7a414
pugixml 60175e80e2f5e97e027ac78f7e14c5acc009ce50
unordered_dense 77e91016354e6d8cba24a86c5abb807de2534c02
wyhash 1e012b57fc2227a9e583a57e2eacb3da99816d99
11666447591127991742
cista fabfc0cbcf07343a2e0c2def3009555b22f0ae46
PEGTL 1c1aa6e650e4d26f10fa398f148ec0cdc5f0808d
res b759b93316afeb529b6cb5b2548b24c41e382fb0
date ce88cc33b5551f66655614eeebb7c5b7189025fb
googletest 7b64fca6ea0833628d6f86255a81424365f7cc0c
fmt dc10f83be70ac2873d5f8d1ce317596f1fd318a2
utl 69e700e03ae3d385304d754cf57877528bc591ef
oh d21c30f40e52a83d6dc09bcffd0067598b5ec069
zlib-ng 68ab3e2d80253ec5dc3c83691d9ff70477b32cd3
boost 73549ebca677fe6214202a1ab580362b4f80e653
doctest 70e8f76437b76dd5e9c0a2eb9b907df190ab71a0
geo cee17208dba98f5f3ddaf78d0bfff9c083557ba3
miniz 1edbdece9d71dc65c6ff405572ee37cbdcef7af4
libressl 24acd9e710fbe842e863572da9d738715fbc74b8
curl 39c8a51e8ee0ab7ea712886df79c068405a2e008
json 410c74782230daaa15054d6ee0975c0607091cb3
opentelemetry-proto 1624689398a3226c45994d70cb544a1e781dc032
abseil-cpp ba5240842d352b4b67a32092453a2fe5fe53a62e
protobuf df2dd518c68b882c9dce5346393f8c388108e733
opentelemetry-cpp 60770dc9dc63e3543fc87d605b2e88fd53d7a414
pugixml 60175e80e2f5e97e027ac78f7e14c5acc009ce50
unordered_dense 77e91016354e6d8cba24a86c5abb807de2534c02
wyhash 1e012b57fc2227a9e583a57e2eacb3da99816d99
2 changes: 1 addition & 1 deletion exe/benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

#include "boost/program_options.hpp"

#include "utl/logging.h"
#include "utl/parallel_for.h"
#include "utl/progress_tracker.h"

#include "nigiri/logging.h"
#include "nigiri/qa/qa.h"
#include "nigiri/query_generator/generator.h"
#include "nigiri/routing/raptor/raptor.h"
Expand Down
8 changes: 4 additions & 4 deletions include/nigiri/footpath.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

#include "fmt/ostream.h"

#include "utl/logging.h"
#include "utl/verify.h"

#include "cista/reflection/printable.h"

#include "nigiri/logging.h"
#include "nigiri/types.h"

namespace nigiri {
Expand Down 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
2 changes: 1 addition & 1 deletion include/nigiri/loader/build_lb_graph.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include "utl/logging.h"
#include "utl/pairwise.h"

#include "nigiri/logging.h"
#include "nigiri/timetable.h"
#include "nigiri/types.h"

Expand Down
72 changes: 0 additions & 72 deletions include/nigiri/logging.h

This file was deleted.

10 changes: 5 additions & 5 deletions include/nigiri/routing/raptor/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@
// #define NIGIRI_RAPTOR_TRACING_ONLY_UPDATES
// #define NIGIRI_RAPTOR_INTERVAL_TRACING

#define trace_upd(...) fmt::print(__VA_ARGS__)
#define trace_upd(...) utl::debug(__VA_ARGS__)

#ifdef NIGIRI_RAPTOR_TRACING_ONLY_UPDATES
#define trace(...)
#else
#define trace(...) fmt::print(__VA_ARGS__)
#define trace(...) utl::debug(__VA_ARGS__)
#endif

#define NIGIRI_TRACE_RECONSTRUCT
#ifdef NIGIRI_TRACE_RECONSTRUCT
#define trace_reconstruct(...) fmt::print(__VA_ARGS__)
#define trace_reconstruct(...) utl::debug(__VA_ARGS__)
#else
#define trace_reconstruct(...)
#endif

#define trace_print_state(...) \
fmt::print(__VA_ARGS__); \
utl::debug(__VA_ARGS__); \
state_.print<Vias>(tt_, base(), kInvalid); \
fmt::print("\n")
utl::debug("\n")

#define trace_print_state_after_round() \
trace_print_state("STATE AFTER ROUND {}\n", k)
Expand Down
2 changes: 1 addition & 1 deletion include/nigiri/routing/search.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
#include "utl/enumerate.h"
#include "utl/equal_ranges_linear.h"
#include "utl/erase_if.h"
#include "utl/logging.h"
#include "utl/timing.h"
#include "utl/to_vec.h"

#include "nigiri/for_each_meta.h"
#include "nigiri/get_otel_tracer.h"
#include "nigiri/logging.h"
#include "nigiri/routing/dijkstra.h"
#include "nigiri/routing/get_fastest_direct.h"
#include "nigiri/routing/interval_estimate.h"
Expand Down
6 changes: 3 additions & 3 deletions include/nigiri/timetable.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "cista/memory_holder.h"
#include "cista/reflection/printable.h"

#include "utl/logging.h"
#include "utl/verify.h"
#include "utl/zip.h"

Expand All @@ -16,7 +17,6 @@
#include "nigiri/common/interval.h"
#include "nigiri/footpath.h"
#include "nigiri/location.h"
#include "nigiri/logging.h"
#include "nigiri/stop.h"
#include "nigiri/td_footpath.h"
#include "nigiri/types.h"
Expand Down 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
12 changes: 5 additions & 7 deletions src/abi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "date/date.h"

#include "utl/helpers/algorithm.h"
#include "utl/logging.h"
#include "utl/overloaded.h"
#include "utl/progress_tracker.h"
#include "utl/verify.h"
Expand All @@ -17,7 +18,6 @@
#include "nigiri/loader/gtfs/loader.h"
#include "nigiri/loader/hrd/loader.h"
#include "nigiri/loader/init_finish.h"
#include "nigiri/logging.h"
#include "nigiri/rt/create_rt_timetable.h"
#include "nigiri/rt/gtfsrt_update.h"
#include "nigiri/rt/rt_timetable.h"
Expand Down Expand Up @@ -61,8 +61,8 @@ 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",
"loading nigiri timetable with configuration {}", (*c)->name());
utl::info("main", "loading nigiri timetable with configuration {}",
(*c)->name());

auto t = new nigiri_timetable_t;
t->tt = std::make_unique<nigiri::timetable>();
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
3 changes: 1 addition & 2 deletions src/clasz.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

#include "cista/hash.h"

#include "utl/logging.h"
#include "utl/verify.h"

#include "nigiri/logging.h"

namespace nigiri {

clasz get_clasz(std::string_view s) {
Expand Down
2 changes: 1 addition & 1 deletion src/loader/build_footpaths.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "utl/equal_ranges_linear.h"
#include "utl/erase_duplicates.h"
#include "utl/erase_if.h"
#include "utl/logging.h"
#include "utl/pairwise.h"
#include "utl/parallel_for.h"
#include "utl/progress_tracker.h"
Expand All @@ -17,7 +18,6 @@
#include "nigiri/loader/merge_duplicates.h"
#include "nigiri/common/day_list.h"
#include "nigiri/constants.h"
#include "nigiri/logging.h"
#include "nigiri/routing/dijkstra.h"
#include "nigiri/rt/frun.h"
#include "nigiri/types.h"
Expand Down
2 changes: 1 addition & 1 deletion src/loader/dir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

#include "cista/mmap.h"

#include "utl/logging.h"
#include "utl/parser/cstr.h"
#include "utl/to_vec.h"
#include "utl/verify.h"

#include "nigiri/logging.h"
#include "wyhash.h"

template <>
Expand Down
2 changes: 1 addition & 1 deletion src/loader/gtfs/load_timetable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <string>

#include "utl/get_or_create.h"
#include "utl/logging.h"
#include "utl/progress_tracker.h"

#include "cista/hash.h"
Expand All @@ -31,7 +32,6 @@
#include "nigiri/loader/gtfs/trip.h"
#include "nigiri/loader/loader_interface.h"
#include "nigiri/common/sort_by.h"
#include "nigiri/logging.h"
#include "nigiri/timetable.h"

namespace fs = std::filesystem;
Expand Down
2 changes: 1 addition & 1 deletion src/loader/gtfs/route.cc
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include "nigiri/loader/gtfs/route.h"

#include "utl/get_or_create.h"
#include "utl/logging.h"
#include "utl/parser/buf_reader.h"
#include "utl/parser/csv_range.h"
#include "utl/parser/line_range.h"
#include "utl/pipes/transform.h"
#include "utl/pipes/vec.h"
#include "utl/progress_tracker.h"

#include "nigiri/logging.h"
#include "nigiri/timetable.h"

namespace nigiri::loader::gtfs {
Expand Down
3 changes: 1 addition & 2 deletions src/loader/gtfs/services.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#include "nigiri/loader/gtfs/services.h"

#include "utl/get_or_create.h"
#include "utl/logging.h"
#include "utl/progress_tracker.h"

#include "nigiri/logging.h"

namespace nigiri::loader::gtfs {

enum class bound { kFirst, kLast };
Expand Down
2 changes: 1 addition & 1 deletion src/loader/gtfs/shape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "geo/latlng.h"

#include "utl/logging.h"
#include "utl/parser/buf_reader.h"
#include "utl/parser/csv_range.h"
#include "utl/parser/line_range.h"
Expand All @@ -10,7 +11,6 @@
#include "utl/sort_by.h"

#include "nigiri/common/cached_lookup.h"
#include "nigiri/logging.h"
#include "nigiri/shapes_storage.h"

namespace nigiri::loader::gtfs {
Expand Down
Loading

0 comments on commit 009154b

Please sign in to comment.