Use \n instead of std::endl to avoid unnecessary flushing. Cleanup some newlines to avoid blank lines in debug output.
This commit is contained in:
parent
6b0fe683c9
commit
65183e94c6
@ -100,7 +100,7 @@ inline void DEBUG_GEOMETRY_START(const contractor::ContractorConfig &config)
|
|||||||
if (dg_output_debug_geometry)
|
if (dg_output_debug_geometry)
|
||||||
{
|
{
|
||||||
debug_geometry_file.open(config.debug_geometry_path, std::ios::binary);
|
debug_geometry_file.open(config.debug_geometry_path, std::ios::binary);
|
||||||
debug_geometry_file << "{\"type\":\"FeatureCollection\", \"features\":[" << std::endl;
|
debug_geometry_file << "{\"type\":\"FeatureCollection\", \"features\":[\n";
|
||||||
debug_geometry_file << std::setprecision(10);
|
debug_geometry_file << std::setprecision(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -113,7 +113,14 @@ inline void DEBUG_GEOMETRY_EDGE(int new_segment_weight,
|
|||||||
if (dg_output_debug_geometry)
|
if (dg_output_debug_geometry)
|
||||||
{
|
{
|
||||||
if (!dg_first_debug_geometry)
|
if (!dg_first_debug_geometry)
|
||||||
debug_geometry_file << "," << std::endl;
|
{
|
||||||
|
debug_geometry_file << ",\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
debug_geometry_file << "\n";
|
||||||
|
dg_first_debug_geometry = false;
|
||||||
|
}
|
||||||
debug_geometry_file << "{ \"type\":\"Feature\",\"properties\":{\"original\":false, "
|
debug_geometry_file << "{ \"type\":\"Feature\",\"properties\":{\"original\":false, "
|
||||||
"\"weight\":"
|
"\"weight\":"
|
||||||
<< new_segment_weight / 10.0 << ",\"speed\":"
|
<< new_segment_weight / 10.0 << ",\"speed\":"
|
||||||
@ -128,9 +135,7 @@ inline void DEBUG_GEOMETRY_EDGE(int new_segment_weight,
|
|||||||
<< node_lookup_map[previous_osm_node_id].lon / osrm::COORDINATE_PRECISION << ","
|
<< node_lookup_map[previous_osm_node_id].lon / osrm::COORDINATE_PRECISION << ","
|
||||||
<< node_lookup_map[previous_osm_node_id].lat / osrm::COORDINATE_PRECISION << "],["
|
<< node_lookup_map[previous_osm_node_id].lat / osrm::COORDINATE_PRECISION << "],["
|
||||||
<< node_lookup_map[this_osm_node_id].lon / osrm::COORDINATE_PRECISION << ","
|
<< node_lookup_map[this_osm_node_id].lon / osrm::COORDINATE_PRECISION << ","
|
||||||
<< node_lookup_map[this_osm_node_id].lat / osrm::COORDINATE_PRECISION << "]]}}"
|
<< node_lookup_map[this_osm_node_id].lat / osrm::COORDINATE_PRECISION << "]]}}";
|
||||||
<< std::endl;
|
|
||||||
dg_first_debug_geometry = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +143,7 @@ inline void DEBUG_GEOMETRY_STOP()
|
|||||||
{
|
{
|
||||||
if (dg_output_debug_geometry)
|
if (dg_output_debug_geometry)
|
||||||
{
|
{
|
||||||
debug_geometry_file << "\n]}" << std::endl;
|
debug_geometry_file << "\n]}" << "\n";
|
||||||
debug_geometry_file.close();
|
debug_geometry_file.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -149,7 +154,7 @@ inline void DEBUG_TURNS_START(const std::string &debug_turns_path)
|
|||||||
if (dg_output_turn_debug)
|
if (dg_output_turn_debug)
|
||||||
{
|
{
|
||||||
dg_debug_turns_file.open(debug_turns_path);
|
dg_debug_turns_file.open(debug_turns_path);
|
||||||
dg_debug_turns_file << "{\"type\":\"FeatureCollection\", \"features\":[" << std::endl;
|
dg_debug_turns_file << "{\"type\":\"FeatureCollection\", \"features\":[" << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +166,7 @@ inline void DEBUG_SIGNAL(const NodeID node,
|
|||||||
{
|
{
|
||||||
const extractor::QueryNode &nodeinfo = m_node_info_list[node];
|
const extractor::QueryNode &nodeinfo = m_node_info_list[node];
|
||||||
if (!dg_first_turn_debug)
|
if (!dg_first_turn_debug)
|
||||||
dg_debug_turns_file << "," << std::endl;
|
dg_debug_turns_file << "," << "\n";
|
||||||
dg_debug_turns_file
|
dg_debug_turns_file
|
||||||
<< "{ \"type\":\"Feature\",\"properties\":{\"type\":\"trafficlights\",\"cost\":"
|
<< "{ \"type\":\"Feature\",\"properties\":{\"type\":\"trafficlights\",\"cost\":"
|
||||||
<< traffic_signal_penalty / 10. << "},";
|
<< traffic_signal_penalty / 10. << "},";
|
||||||
@ -180,7 +185,7 @@ inline void DEBUG_UTURN(const NodeID node,
|
|||||||
{
|
{
|
||||||
const extractor::QueryNode &nodeinfo = m_node_info_list[node];
|
const extractor::QueryNode &nodeinfo = m_node_info_list[node];
|
||||||
if (!dg_first_turn_debug)
|
if (!dg_first_turn_debug)
|
||||||
dg_debug_turns_file << "," << std::endl;
|
dg_debug_turns_file << "," << "\n";
|
||||||
dg_debug_turns_file
|
dg_debug_turns_file
|
||||||
<< "{ \"type\":\"Feature\",\"properties\":{\"type\":\"trafficlights\",\"cost\":"
|
<< "{ \"type\":\"Feature\",\"properties\":{\"type\":\"trafficlights\",\"cost\":"
|
||||||
<< traffic_signal_penalty / 10. << "},";
|
<< traffic_signal_penalty / 10. << "},";
|
||||||
@ -209,7 +214,7 @@ inline void DEBUG_TURN(const NodeID node,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!dg_first_turn_debug)
|
if (!dg_first_turn_debug)
|
||||||
dg_debug_turns_file << "," << std::endl;
|
dg_debug_turns_file << "," << "\n";
|
||||||
dg_debug_turns_file << "{ \"type\":\"Feature\",\"properties\":{\"type\":\"turn\",\"cost\":"
|
dg_debug_turns_file << "{ \"type\":\"Feature\",\"properties\":{\"type\":\"turn\",\"cost\":"
|
||||||
<< turn_penalty / 10.
|
<< turn_penalty / 10.
|
||||||
<< ",\"turn_angle\":" << static_cast<int>(turn_angle)
|
<< ",\"turn_angle\":" << static_cast<int>(turn_angle)
|
||||||
@ -225,7 +230,7 @@ inline void DEBUG_TURNS_STOP()
|
|||||||
{
|
{
|
||||||
if (dg_output_turn_debug)
|
if (dg_output_turn_debug)
|
||||||
{
|
{
|
||||||
dg_debug_turns_file << "\n]}" << std::endl;
|
dg_debug_turns_file << "\n]}" << "\n";
|
||||||
dg_debug_turns_file.close();
|
dg_debug_turns_file.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user