Refactor logging, improve error handling workflow, clang-format. (#3385)
This commit is contained in:
@@ -12,11 +12,13 @@
|
||||
#include "util/guidance/turn_lanes.hpp"
|
||||
|
||||
#include "engine/geospatial_query.hpp"
|
||||
#include "util/exception.hpp"
|
||||
#include "util/exception_utils.hpp"
|
||||
#include "util/guidance/turn_bearing.hpp"
|
||||
#include "util/log.hpp"
|
||||
#include "util/packed_vector.hpp"
|
||||
#include "util/range_table.hpp"
|
||||
#include "util/rectangle.hpp"
|
||||
#include "util/simple_logger.hpp"
|
||||
#include "util/static_graph.hpp"
|
||||
#include "util/static_rtree.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
@@ -116,7 +118,7 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
{
|
||||
m_check_sum =
|
||||
*data_layout.GetBlockPtr<unsigned>(memory_block, storage::DataLayout::HSGR_CHECKSUM);
|
||||
util::SimpleLogger().Write() << "set checksum: " << m_check_sum;
|
||||
util::Log() << "set checksum: " << m_check_sum;
|
||||
}
|
||||
|
||||
void InitializeProfilePropertiesPointer(storage::DataLayout &data_layout, char *memory_block)
|
||||
@@ -144,9 +146,9 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
|
||||
file_index_path = boost::filesystem::path(file_index_ptr);
|
||||
if (!boost::filesystem::exists(file_index_path))
|
||||
{
|
||||
util::SimpleLogger().Write(logDEBUG) << "Leaf file name " << file_index_path.string();
|
||||
util::Log(logDEBUG) << "Leaf file name " << file_index_path.string();
|
||||
throw util::exception("Could not load " + file_index_path.string() +
|
||||
"Is any data loaded into shared memory?");
|
||||
"Is any data loaded into shared memory?" + SOURCE_REF);
|
||||
}
|
||||
|
||||
auto tree_ptr =
|
||||
|
||||
@@ -56,8 +56,7 @@ class SharedMemoryDataFacade : public ContiguousInternalMemoryDataFacadeBase
|
||||
|
||||
if (current_timestamp->timestamp == shared_timestamp)
|
||||
{
|
||||
util::SimpleLogger().Write(logDEBUG) << "Retaining data with shared timestamp "
|
||||
<< shared_timestamp;
|
||||
util::Log(logDEBUG) << "Retaining data with shared timestamp " << shared_timestamp;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -74,8 +73,7 @@ class SharedMemoryDataFacade : public ContiguousInternalMemoryDataFacadeBase
|
||||
: shared_barriers(shared_barriers_), layout_region(layout_region_),
|
||||
data_region(data_region_), shared_timestamp(shared_timestamp_)
|
||||
{
|
||||
util::SimpleLogger().Write(logDEBUG) << "Loading new data with shared timestamp "
|
||||
<< shared_timestamp;
|
||||
util::Log(logDEBUG) << "Loading new data with shared timestamp " << shared_timestamp;
|
||||
|
||||
BOOST_ASSERT(storage::SharedMemory::RegionExists(layout_region));
|
||||
m_layout_memory = storage::makeSharedMemory(layout_region);
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#include "engine/plugins/trip.hpp"
|
||||
#include "engine/plugins/viaroute.hpp"
|
||||
#include "engine/status.hpp"
|
||||
#include "util/exception.hpp"
|
||||
#include "util/exception_utils.hpp"
|
||||
#include "util/json_container.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -235,10 +235,10 @@ class AlternativeRouting final
|
||||
}
|
||||
}
|
||||
|
||||
// util::SimpleLogger().Write(logDEBUG) << "fwd_search_space size: " <<
|
||||
// util::Log(logDEBUG) << "fwd_search_space size: " <<
|
||||
// forward_search_space.size() << ", marked " << approximated_forward_sharing.size() << "
|
||||
// nodes";
|
||||
// util::SimpleLogger().Write(logDEBUG) << "rev_search_space size: " <<
|
||||
// util::Log(logDEBUG) << "rev_search_space size: " <<
|
||||
// reverse_search_space.size() << ", marked " << approximated_reverse_sharing.size() << "
|
||||
// nodes";
|
||||
|
||||
@@ -601,7 +601,7 @@ class AlternativeRouting final
|
||||
// //compute forward sharing
|
||||
// while( (packed_alternate_path[aindex] == packed_shortest_path[aindex]) &&
|
||||
// (packed_alternate_path[aindex+1] == packed_shortest_path[aindex+1]) ) {
|
||||
// // util::SimpleLogger().Write() << "retrieving edge (" <<
|
||||
// // util::Log() << "retrieving edge (" <<
|
||||
// packed_alternate_path[aindex] << "," << packed_alternate_path[aindex+1] << ")";
|
||||
// EdgeID edgeID = facade->FindEdgeInEitherDirection(packed_alternate_path[aindex],
|
||||
// packed_alternate_path[aindex+1]);
|
||||
@@ -640,7 +640,7 @@ class AlternativeRouting final
|
||||
const NodeID node = forward_heap.DeleteMin();
|
||||
const int weight = forward_heap.GetKey(node);
|
||||
// const NodeID parentnode = forward_heap.GetData(node).parent;
|
||||
// util::SimpleLogger().Write() << (is_forward_directed ? "[fwd] " : "[rev] ") << "settled
|
||||
// util::Log() << (is_forward_directed ? "[fwd] " : "[rev] ") << "settled
|
||||
// edge ("
|
||||
// << parentnode << "," << node << "), dist: " << weight;
|
||||
|
||||
@@ -665,11 +665,11 @@ class AlternativeRouting final
|
||||
{
|
||||
*middle_node = node;
|
||||
*upper_bound_to_shortest_path_weight = new_weight;
|
||||
// util::SimpleLogger().Write() << "accepted middle_node " << *middle_node
|
||||
// util::Log() << "accepted middle_node " << *middle_node
|
||||
// << " at
|
||||
// weight " << new_weight;
|
||||
// } else {
|
||||
// util::SimpleLogger().Write() << "discarded middle_node " << *middle_node
|
||||
// util::Log() << "discarded middle_node " << *middle_node
|
||||
// << "
|
||||
// at weight " << new_weight;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define TRIP_BRUTE_FORCE_HPP
|
||||
|
||||
#include "util/dist_table_wrapper.hpp"
|
||||
#include "util/simple_logger.hpp"
|
||||
#include "util/log.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
#include "osrm/json_container.hpp"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define TRIP_NEAREST_NEIGHBOUR_HPP
|
||||
|
||||
#include "util/dist_table_wrapper.hpp"
|
||||
#include "util/simple_logger.hpp"
|
||||
#include "util/log.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
#include "osrm/json_container.hpp"
|
||||
|
||||
Reference in New Issue
Block a user