diff options
Diffstat (limited to 'xs/src/libslic3r/utils.cpp')
-rw-r--r-- | xs/src/libslic3r/utils.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/xs/src/libslic3r/utils.cpp b/xs/src/libslic3r/utils.cpp index 3f340e04a..0f298e954 100644 --- a/xs/src/libslic3r/utils.cpp +++ b/xs/src/libslic3r/utils.cpp @@ -66,3 +66,30 @@ confess_at(const char *file, int line, const char *func, } #endif + +#include <boost/log/core.hpp> +#include <boost/log/trivial.hpp> +#include <boost/log/expressions.hpp> + +namespace Slic3r { + +static boost::log::trivial::severity_level logSeverity = boost::log::trivial::fatal; + +void set_logging_level(unsigned int level) +{ + switch (level) { + case 0: logSeverity = boost::log::trivial::fatal; break; + case 1: logSeverity = boost::log::trivial::error; break; + case 2: logSeverity = boost::log::trivial::warning; break; + case 3: logSeverity = boost::log::trivial::info; break; + case 4: logSeverity = boost::log::trivial::debug; break; + default: logSeverity = boost::log::trivial::trace; break; + } + + boost::log::core::get()->set_filter + ( + boost::log::trivial::severity >= logSeverity + ); +} + +} // namespace Slic3r |