Example:
#ifndef LOG_H_header #define LOG_H_header #include <boost/logging/logging.hpp> #include <boost/logging/format/optimize.hpp> BOOST_LOG_FORMAT_MSG( boost::logging::optimize::cache_string_one_str<> ) #if defined(BOOST_LOG_DEFINE_LOGS) #include <boost/logging/format.hpp> typedef logger_format_write< > logger_type; #endif BOOST_DECLARE_LOG(g_l, logger_type) BOOST_DECLARE_LOG_FILTER(g_l_filter, level::holder) #define LDBG_ BOOST_LOG_USE_LOG_IF_LEVEL(g_l(), g_log_level(), debug ) << "[dbg] " #define LERR_ BOOST_LOG_USE_LOG_IF_LEVEL(g_l(), g_log_level(), error ) << "[ERR] " #define LAPP_ BOOST_LOG_USE_LOG_IF_LEVEL(g_l(), g_log_level(), info ) << "[app] " void init_logs(); #endif