diff --git a/utils/mapnik-render/mapnik-render.cpp b/utils/mapnik-render/mapnik-render.cpp index c39922639..4dbe166c6 100644 --- a/utils/mapnik-render/mapnik-render.cpp +++ b/utils/mapnik-render/mapnik-render.cpp @@ -30,6 +30,22 @@ int main (int argc,char** argv) mapnik::logger logger; logger.set_severity(mapnik::logger::error); + const char *envsev = std::getenv("MAPNIK_LOG_SEVERITY"); + if ( envsev != nullptr) + { + if ( ! strncmp(envsev, "deb", 3) ) + logger.set_severity(mapnik::logger::debug); + else if ( ! strncmp(envsev, "warn", 4) ) + logger.set_severity(mapnik::logger::warn); + else if ( ! strncmp(envsev, "err", 3) ) + logger.set_severity(mapnik::logger::error); + else + MAPNIK_LOG_ERROR("logger") << + "Invalid value for MAPNIK_LOG_SEVERITY" + " environment variable, expected " + "'debug', 'warning' or 'error'"; + } + try { po::options_description desc("mapnik-render utility");