Get rid of printf and cout by using Log::*

Use our logging system that will route the message accordingly on
the target platform.

Fixes #613
This commit is contained in:
Thiago Marcos P. Santos
2015-03-11 17:19:16 +02:00
parent 2b6afe6a54
commit 124b49562d
17 changed files with 65 additions and 54 deletions

View File

@@ -1,5 +1,6 @@
#include <mbgl/map/tile_parser.hpp>
#include <mbgl/map/vector_tile_data.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/style/style.hpp>
#include <mbgl/style/style_layer.hpp>
#include <mbgl/style/style_layer_group.hpp>
@@ -85,7 +86,7 @@ void TileParser::parseStyleLayers(util::ptr<const StyleLayerGroup> group) {
}
}
} else {
fprintf(stderr, "[WARNING] layer '%s' does not have buckets\n", layer_desc->id.c_str());
Log::Warning(Event::ParseTile, "layer '%s' does not have buckets", layer_desc->id.c_str());
}
}
}
@@ -198,12 +199,13 @@ std::unique_ptr<Bucket> TileParser::createBucket(const StyleBucket &bucketDesc)
} else if (bucketDesc.type == StyleLayerType::Raster) {
return nullptr;
} else {
fprintf(stderr, "[WARNING] unknown bucket render type for layer '%s' (source layer '%s')\n", bucketDesc.name.c_str(), bucketDesc.source_layer.c_str());
Log::Warning(Event::ParseTile, "unknown bucket render type for layer '%s' (source layer '%s')",
bucketDesc.name.c_str(), bucketDesc.source_layer.c_str());
}
} else {
// The layer specified in the bucket does not exist. Do nothing.
if (debug::tileParseWarnings) {
fprintf(stderr, "[WARNING] layer '%s' does not exist in tile %d/%d/%d\n",
Log::Warning(Event::ParseTile, "layer '%s' does not exist in tile %d/%d/%d",
bucketDesc.source_layer.c_str(), tile.id.z, tile.id.x, tile.id.y);
}
}