From 4b17ea95fcffab9e513b58095aa0367e18248fcd Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 20 Dec 2018 16:10:30 +0000 Subject: [PATCH] Random buildings: reduce log output in a common case --- simgear/scene/tgdb/SGTileDetailsCallback.hxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/simgear/scene/tgdb/SGTileDetailsCallback.hxx b/simgear/scene/tgdb/SGTileDetailsCallback.hxx index e7612c68..6a16c5da 100644 --- a/simgear/scene/tgdb/SGTileDetailsCallback.hxx +++ b/simgear/scene/tgdb/SGTileDetailsCallback.hxx @@ -689,10 +689,13 @@ public: triangleBuildingList.clear(); } - SG_LOG(SG_TERRAIN, SG_DEBUG, "Random Buildings: " << ((bin) ? bin->getNumBuildings() : 0)); - SG_LOG(SG_TERRAIN, SG_DEBUG, " Dropped due to mask: " << mask_dropped); - SG_LOG(SG_TERRAIN, SG_DEBUG, " Dropped due to random object: " << random_dropped); - SG_LOG(SG_TERRAIN, SG_DEBUG, " Dropped due to other buildings: " << building_dropped); + const int numBuildings = (bin) ? bin->getNumBuildings() : 0; + if (numBuildings > 0) { + SG_LOG(SG_TERRAIN, SG_DEBUG, "computed Random Buildings: " << numBuildings); + SG_LOG(SG_TERRAIN, SG_DEBUG, " Dropped due to mask: " << mask_dropped); + SG_LOG(SG_TERRAIN, SG_DEBUG, " Dropped due to random object: " << random_dropped); + SG_LOG(SG_TERRAIN, SG_DEBUG, " Dropped due to other buildings: " << building_dropped); + } } }