2012-04-09 01:00:51 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* This file is part of Mapnik (c++ mapping toolkit)
|
|
|
|
*
|
2014-11-20 14:25:50 +00:00
|
|
|
* Copyright (C) 2014 Artem Pavlenko, Jean-Francois Doyon
|
2012-04-09 01:00:51 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2014-08-12 17:44:11 +00:00
|
|
|
#include <mapnik/config.hpp>
|
2014-10-21 23:37:27 +00:00
|
|
|
|
|
|
|
// boost
|
2013-10-23 22:42:01 +00:00
|
|
|
#include "boost_std_shared_shim.hpp"
|
2014-10-21 23:37:27 +00:00
|
|
|
#pragma GCC diagnostic push
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
|
|
|
#pragma GCC diagnostic ignored "-Wunused-local-typedef"
|
|
|
|
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
2013-10-23 22:42:01 +00:00
|
|
|
|
2012-04-09 01:00:51 +00:00
|
|
|
#include <boost/python.hpp>
|
2012-12-16 20:50:36 +00:00
|
|
|
#include <boost/noncopyable.hpp>
|
2014-10-21 23:37:27 +00:00
|
|
|
#pragma GCC diagnostic pop
|
2012-12-16 20:50:36 +00:00
|
|
|
|
2012-04-09 01:00:51 +00:00
|
|
|
#include <mapnik/debug.hpp>
|
2012-04-10 08:14:28 +00:00
|
|
|
#include <mapnik/utils.hpp>
|
2012-04-14 00:52:13 +00:00
|
|
|
#include "mapnik_enumeration.hpp"
|
2012-04-09 01:00:51 +00:00
|
|
|
|
2012-04-09 22:25:31 +00:00
|
|
|
void export_logger()
|
|
|
|
{
|
2012-04-10 08:14:28 +00:00
|
|
|
using mapnik::logger;
|
2012-04-09 01:00:51 +00:00
|
|
|
using mapnik::singleton;
|
|
|
|
using mapnik::CreateStatic;
|
|
|
|
using namespace boost::python;
|
2012-04-09 22:25:31 +00:00
|
|
|
|
2012-04-10 08:14:28 +00:00
|
|
|
class_<singleton<logger,CreateStatic>,boost::noncopyable>("Singleton",no_init)
|
|
|
|
.def("instance",&singleton<logger,CreateStatic>::instance,
|
2012-04-09 01:00:51 +00:00
|
|
|
return_value_policy<reference_existing_object>())
|
|
|
|
.staticmethod("instance")
|
|
|
|
;
|
|
|
|
|
2012-04-14 00:52:13 +00:00
|
|
|
enum_<mapnik::logger::severity_type>("severity_type")
|
|
|
|
.value("Debug", logger::debug)
|
|
|
|
.value("Warn", logger::warn)
|
|
|
|
.value("Error", logger::error)
|
|
|
|
.value("None", logger::none)
|
|
|
|
;
|
|
|
|
|
2012-04-10 08:14:28 +00:00
|
|
|
class_<logger,bases<singleton<logger,CreateStatic> >,
|
|
|
|
boost::noncopyable>("logger",no_init)
|
|
|
|
.def("get_severity", &logger::get_severity)
|
|
|
|
.def("set_severity", &logger::set_severity)
|
|
|
|
.def("get_object_severity", &logger::get_object_severity)
|
|
|
|
.def("set_object_severity", &logger::set_object_severity)
|
|
|
|
.def("clear_object_severity", &logger::clear_object_severity)
|
|
|
|
.def("get_format", &logger::get_format)
|
|
|
|
.def("set_format", &logger::set_format)
|
|
|
|
.def("str", &logger::str)
|
|
|
|
.def("use_file", &logger::use_file)
|
|
|
|
.def("use_console", &logger::use_console)
|
|
|
|
.staticmethod("get_severity")
|
|
|
|
.staticmethod("set_severity")
|
|
|
|
.staticmethod("get_object_severity")
|
|
|
|
.staticmethod("set_object_severity")
|
|
|
|
.staticmethod("clear_object_severity")
|
|
|
|
.staticmethod("get_format")
|
|
|
|
.staticmethod("set_format")
|
|
|
|
.staticmethod("str")
|
|
|
|
.staticmethod("use_file")
|
|
|
|
.staticmethod("use_console")
|
2012-04-09 01:00:51 +00:00
|
|
|
;
|
|
|
|
}
|