Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <boost/log/core.hpp>
- #include <boost/log/expressions.hpp>
- #include <boost/log/sinks/text_file_backend.hpp>
- #include <boost/log/sources/record_ostream.hpp>
- #include <boost/log/sources/severity_logger.hpp>
- #include <boost/log/trivial.hpp>
- #include <boost/log/utility/setup/common_attributes.hpp>
- #include <boost/log/utility/setup/console.hpp>
- #include <boost/log/utility/setup/file.hpp>
- namespace is = ImageStitching;
- namespace logging = boost::log;
- namespace src = boost::log::sources;
- namespace sinks = boost::log::sinks;
- namespace keywords = boost::log::keywords;
- void log_init() {
- logging::register_simple_formatter_factory<
- boost::log::trivial::severity_level, char>("Severity");
- logging::add_file_log(
- keywords::target = "logs/", keywords::file_name = "%y%m%d_%3N.log",
- keywords::rotation_size = 10 * 1024 * 1024,
- keywords::scan_method = sinks::file::scan_matching,
- keywords::format = "[%TimeStamp%][%Severity%]: %Message%");
- logging::add_console_log(std::cout,
- boost::log::keywords::format = ">> %Message%");
- logging::core::get()->set_filter(logging::trivial::severity >=
- logging::trivial::info);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement