7 #include <boost/log/sources/global_logger_storage.hpp> 8 #include <boost/log/sources/record_ostream.hpp> 9 #include <boost/log/sources/severity_logger.hpp> 10 #include <boost/log/utility/manipulators/add_value.hpp> 12 #ifndef JB_MIN_LOG_LEVEL 13 #define JB_MIN_LOG_LEVEL debug 14 #endif // JB_MIN_LOG_LEVEL 52 logger, boost::log::sources::severity_logger_mt<severity_level>)
60 #define JB_LOG_I(logger, lvl, rec_var) \ 61 if (not::jb::severity_static_predicate(lvl)) { \ 63 for (::boost::log::record rec_var = \ 64 (logger).open_record(boost::log::keywords::severity = lvl); \ 66 ::boost::log::aux::make_record_pump((logger), rec_var).stream() \ 67 << boost::log::add_value("Filename", __FILE__) \ 68 << boost::log::add_value("Lineno", static_cast<int>(__LINE__)) 72 ::jb::log::logger::get(), jb::severity_level::lvl, \ 73 BOOST_LOG_UNIQUE_IDENTIFIER_NAME(jb_log_record_)) 75 #define JB_LOG_VAR(lvl) \ 77 ::jb::log::logger::get(), lvl, \ 78 BOOST_LOG_UNIQUE_IDENTIFIER_NAME(jb_log_record_)) jb::config_attribute< config, bool > enable_file_logging
BOOST_LOG_INLINE_GLOBAL_LOGGER_DEFAULT(logger, boost::log::sources::severity_logger_mt< severity_level >) void next_tid()
Define the global logger for JayBeams.
severity_level
Severity levels for JayBeams, based on syslog.
Base class for all configuration objects.
jb::config_attribute< config, std::string > logfile_basename
void validate() const override
Validate the settings.
Configuration object for the logging functions.
jb::config_attribute< config, std::string > logfile_archive_directory
jb::config_attribute< config, long > maximum_size_archived
void init(config const &cfg)
Initialize the logging functions using the configuration provided.
jb::config_attribute< config, std::string > logfile_suffix
config_object_constructors(config)
Helper class to easily define configuration attributes.
jb::config_attribute< config, jb::severity_level > minimum_console_severity
constexpr bool severity_static_predicate(jb::severity_level lvl)
Statically check if the severity level should even be compiled in.
jb::config_attribute< config, jb::severity_level > minimum_severity
jb::config_attribute< config, bool > enable_console_logging
jb::config_attribute< config, long > minimum_free_space
The top-level namespace for the JayBeams library.