6#ifndef FIRE_LOGGING_LOGGER_H
7#define FIRE_LOGGING_LOGGER_H
17#define BOOST_ALL_DYN_LINK 1
19#include <boost/log/core.hpp>
20#include <boost/log/expressions.hpp>
21#include <boost/log/sinks/sync_frontend.hpp>
22#include <boost/log/sinks/text_ostream_backend.hpp>
23#include <boost/log/sources/global_logger_storage.hpp>
24#include <boost/log/sources/severity_channel_logger.hpp>
25#include <boost/log/sources/severity_feature.hpp>
26#include <boost/log/utility/setup/common_attributes.hpp>
29#include <boost/log/sources/record_ostream.hpp>
30#include <boost/log/utility/setup/file.hpp>
32#include <unordered_map>
73namespace log = boost::log;
76namespace sinks = boost::log::sinks;
84using logger = log::sources::severity_channel_logger_mt<level, std::string>;
139#define ENABLE_LOGGING(name) \
140 mutable logging::logger theLog_{logging::makeLogger(#name)};
150#define fire_log(lvl) BOOST_LOG_SEV(theLog_, fire::logging::level::lvl)
Housing for logging infrastructure.
Definition: Logger.h:40
void open(const level termLevel, const level fileLevel, const std::string &fileName)
Initialize the logging backend.
Definition: Logger.cxx:56
void close()
Close up the logging.
Definition: Logger.cxx:131
level
Different logging levels available to fire's log.
Definition: Logger.h:48
@ debug
0
Definition: Logger.h:50
@ fatal
5
Definition: Logger.h:58
@ error
3
Definition: Logger.h:56
@ warn
2
Definition: Logger.h:54
@ info
1
Definition: Logger.h:52
logger makeLogger(const std::string &name)
Gets a logger for the user.
Definition: Logger.cxx:51
level convertLevel(int iLvl)
Convert an integer to the severity level enum.
Definition: Logger.cxx:15
log::sources::severity_channel_logger_mt< level, std::string > logger
Short names for boost::log.
Definition: Logger.h:84