From cda9089ddf0ce7ac1f3cf62d6b391ee05ed89e08 Mon Sep 17 00:00:00 2001 From: Lucio Asnaghi Date: Thu, 18 Nov 2010 22:59:21 +0000 Subject: [PATCH] + ogr logging cosmetics --- plugins/input/ogr/ogr_converter.cpp | 5 +---- plugins/input/ogr/ogr_datasource.cpp | 15 ++++++--------- plugins/input/ogr/ogr_featureset.cpp | 13 +++++-------- plugins/input/ogr/ogr_index_featureset.cpp | 16 +++++++--------- 4 files changed, 19 insertions(+), 30 deletions(-) diff --git a/plugins/input/ogr/ogr_converter.cpp b/plugins/input/ogr/ogr_converter.cpp index 32fa60350..e6b9f8461 100644 --- a/plugins/input/ogr/ogr_converter.cpp +++ b/plugins/input/ogr/ogr_converter.cpp @@ -32,9 +32,6 @@ // ogr #include "ogr_converter.hpp" -using std::clog; -using std::endl; - using mapnik::feature_ptr; using mapnik::geometry_utils; using mapnik::geometry_type; @@ -84,7 +81,7 @@ void ogr_converter::convert_geometry (OGRGeometry* geom, feature_ptr feature, bo case wkbUnknown: default: #ifdef MAPNIK_DEBUG - clog << "unknown geometry_type=" << wkbFlatten (geom->getGeometryType()) << endl; + std::clog << "OGR Plugin: unknown geometry_type=" << wkbFlatten (geom->getGeometryType()) << std::endl; #endif break; } diff --git a/plugins/input/ogr/ogr_datasource.cpp b/plugins/input/ogr/ogr_datasource.cpp index 9f09eb582..f99a2f9d8 100644 --- a/plugins/input/ogr/ogr_datasource.cpp +++ b/plugins/input/ogr/ogr_datasource.cpp @@ -36,9 +36,6 @@ // boost #include -using std::clog; -using std::endl; - using mapnik::datasource; using mapnik::parameters; @@ -108,9 +105,9 @@ void ogr_datasource::bind() const { std::string err = CPLGetLastErrorMsg(); if( err.size() == 0 ) { - throw datasource_exception("Connection failed: " + dataset_name_ + " was not found or is not a supported format"); + throw datasource_exception("OGR Plugin: connection failed: " + dataset_name_ + " was not found or is not a supported format"); } else { - throw datasource_exception(err); + throw datasource_exception("OGR Plugin: " + err); } } @@ -152,7 +149,7 @@ void ogr_datasource::bind() const else { std::ostringstream s; - s << "missing or parameter, available layers are: "; + s << "OGR Plugin: missing or parameter, available layers are: "; unsigned num_layers = dataset_->GetLayerCount(); bool found = false; for (unsigned i = 0; i < num_layers; ++i ) @@ -239,7 +236,7 @@ void ogr_datasource::bind() const case OFTStringList: case OFTWideStringList: // deprecated ! #ifdef MAPNIK_DEBUG - clog << "unhandled type_oid=" << type_oid << endl; + std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl; #endif break; @@ -247,14 +244,14 @@ void ogr_datasource::bind() const case OFTTime: case OFTDateTime: // unhandled ! #ifdef MAPNIK_DEBUG - clog << "unhandled type_oid=" << type_oid << endl; + std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl; #endif desc_.add_descriptor(attribute_descriptor(fld_name,mapnik::Object)); break; default: // unknown #ifdef MAPNIK_DEBUG - clog << "unknown type_oid=" << type_oid << endl; + std::clog << "OGR Plugin: unknown type_oid=" << type_oid << std::endl; #endif break; } diff --git a/plugins/input/ogr/ogr_featureset.cpp b/plugins/input/ogr/ogr_featureset.cpp index 975b52413..56fd2febe 100644 --- a/plugins/input/ogr/ogr_featureset.cpp +++ b/plugins/input/ogr/ogr_featureset.cpp @@ -35,9 +35,6 @@ #include "ogr_converter.hpp" #include "ogr_feature_ptr.hpp" -using std::clog; -using std::endl; - using mapnik::query; using mapnik::box2d; using mapnik::CoordTransform; @@ -132,7 +129,7 @@ feature_ptr ogr_featureset::next() case OFTWideStringList: // deprecated ! { #ifdef MAPNIK_DEBUG - clog << "unhandled type_oid=" << type_oid << endl; + std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl; #endif break; } @@ -140,7 +137,7 @@ feature_ptr ogr_featureset::next() case OFTBinary: { #ifdef MAPNIK_DEBUG - clog << "unhandled type_oid=" << type_oid << endl; + std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl; #endif //boost::put(*feature,name,feat->GetFieldAsBinary (i, size)); break; @@ -151,7 +148,7 @@ feature_ptr ogr_featureset::next() case OFTDateTime: // unhandled ! { #ifdef MAPNIK_DEBUG - clog << "unhandled type_oid=" << type_oid << endl; + std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl; #endif break; } @@ -159,7 +156,7 @@ feature_ptr ogr_featureset::next() default: // unknown { #ifdef MAPNIK_DEBUG - clog << "unknown type_oid=" << type_oid << endl; + std::clog << "OGR Plugin: unknown type_oid=" << type_oid << std::endl; #endif break; } @@ -171,7 +168,7 @@ feature_ptr ogr_featureset::next() } #ifdef MAPNIK_DEBUG - clog << count_ << " features" << endl; + std::clog << "OGR Plugin: " << count_ << " features" << std::endl; #endif return feature_ptr(); } diff --git a/plugins/input/ogr/ogr_index_featureset.cpp b/plugins/input/ogr/ogr_index_featureset.cpp index ec4926a1a..6f8447eee 100644 --- a/plugins/input/ogr/ogr_index_featureset.cpp +++ b/plugins/input/ogr/ogr_index_featureset.cpp @@ -42,9 +42,6 @@ #include "ogr_index.hpp" #include "ogr_feature_ptr.hpp" -using std::clog; -using std::endl; - using mapnik::query; using mapnik::box2d; using mapnik::CoordTransform; @@ -81,7 +78,7 @@ ogr_index_featureset::ogr_index_featureset(OGRDataSource & dataset, std::sort(ids_.begin(),ids_.end()); #ifdef MAPNIK_DEBUG - std::clog<< "query size=" << ids_.size() << "\n"; + std::clog << "OGR Plugin: query size=" << ids_.size() << std::endl; #endif itr_ = ids_.begin(); @@ -147,7 +144,7 @@ feature_ptr ogr_index_featureset::next() case OFTWideStringList: // deprecated ! { #ifdef MAPNIK_DEBUG - clog << "unhandled type_oid=" << type_oid << endl; + std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl; #endif break; } @@ -155,7 +152,7 @@ feature_ptr ogr_index_featureset::next() case OFTBinary: { #ifdef MAPNIK_DEBUG - clog << "unhandled type_oid=" << type_oid << endl; + std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl; #endif //boost::put(*feature,name,feat->GetFieldAsBinary (i, size)); break; @@ -166,7 +163,7 @@ feature_ptr ogr_index_featureset::next() case OFTDateTime: // unhandled ! { #ifdef MAPNIK_DEBUG - clog << "unhandled type_oid=" << type_oid << endl; + std::clog << "OGR Plugin: unhandled type_oid=" << type_oid << std::endl; #endif break; } @@ -174,7 +171,7 @@ feature_ptr ogr_index_featureset::next() default: // unknown { #ifdef MAPNIK_DEBUG - clog << "unknown type_oid=" << type_oid << endl; + std::clog << "OGR Plugin: unknown type_oid=" << type_oid << std::endl; #endif break; } @@ -187,8 +184,9 @@ feature_ptr ogr_index_featureset::next() } #ifdef MAPNIK_DEBUG - clog << count_ << " features" << endl; + std::clog << "OGR Plugin: " << count_ << " features" << std::endl; #endif + return feature_ptr(); }