- avoid using clog/cerr in sqlite plugin (use mapnik::logging facilities instead)

This commit is contained in:
kunitoki 2013-03-27 09:02:40 +01:00
parent af2bb2be1e
commit 26ba946cb0
3 changed files with 19 additions and 14 deletions

View file

@ -24,6 +24,7 @@
#define MAPNIK_SQLITE_PREPARED_HPP
// mapnik
#include <mapnik/debug.hpp>
#include <mapnik/datasource.hpp>
#include <mapnik/params.hpp>
#include <mapnik/box2d.hpp>
@ -77,11 +78,13 @@ public:
{
if (*(*ds_))
{
std::cerr << "ERR:" << sqlite3_errmsg(*(*ds_)) << "\n";
MAPNIK_LOG_ERROR(sqlite) << "~prepared_index_statement:"
<< sqlite3_errmsg(*(*ds_));
}
else
{
std::cerr << "SQLite Plugin: " << res << "\n";
MAPNIK_LOG_ERROR(sqlite) << "~prepared_index_statement:"
<< res;
}
}
}

View file

@ -24,6 +24,7 @@
#define MAPNIK_SQLITE_RESULTSET_HPP
// mapnik
#include <mapnik/debug.hpp>
#include <mapnik/datasource.hpp>
#include <mapnik/params.hpp>

View file

@ -29,6 +29,7 @@
#include <algorithm>
// mapnik
#include <mapnik/debug.hpp>
#include <mapnik/datasource.hpp>
#include <mapnik/params.hpp>
#include <mapnik/geometry.hpp>
@ -556,7 +557,7 @@ public:
}
catch (std::exception const& ex)
{
//std::clog << "no: " << ex.what() << "\n";
MAPNIK_LOG_DEBUG(sqlite) << "has_rtree returned:" << ex.what();
return false;
}
return false;
@ -609,9 +610,7 @@ public:
break;
default:
#ifdef MAPNIK_DEBUG
std::clog << "Sqlite Plugin: unknown type_oid=" << type_oid << std::endl;
#endif
MAPNIK_LOG_DEBUG(sqlite) << "detect_types_from_subquery: unknown type_oid=" << type_oid;
break;
}
}
@ -691,20 +690,22 @@ public:
desc.add_descriptor(mapnik::attribute_descriptor(fld_name, mapnik::String));
}
}
#ifdef MAPNIK_DEBUG
else
{
// "Column Affinity" says default to "Numeric" but for now we pass..
//desc_.add_descriptor(attribute_descriptor(fld_name,mapnik::Double));
// TODO - this should not fail when we specify geometry_field in XML file
std::clog << "Sqlite Plugin: column '"
<< std::string(fld_name)
<< "' unhandled due to unknown type: "
<< fld_type << std::endl;
}
#ifdef MAPNIK_LOG
// Do not fail when we specify geometry_field in XML file
if (field.empty())
{
MAPNIK_LOG_DEBUG(sqlite) << "Column '"
<< std::string(fld_name)
<< "' unhandled due to unknown type: "
<< fld_type;
}
#endif
}
}
}