Refactor logging, improve error handling workflow, clang-format. (#3385)

This commit is contained in:
Daniel Patterson
2016-12-06 12:30:46 -08:00
committed by GitHub
parent 6f4c6e84ae
commit 468d8c0031
62 changed files with 1778 additions and 1607 deletions
@@ -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);