|
fire v0.19.0
Framework for sImulation and Reconstruction of Events
|
Interface to Boost.Logging. More...
#include <boost/log/core.hpp>#include <boost/log/expressions.hpp>#include <boost/log/sinks/sync_frontend.hpp>#include <boost/log/sinks/text_ostream_backend.hpp>#include <boost/log/sources/global_logger_storage.hpp>#include <boost/log/sources/severity_channel_logger.hpp>#include <boost/log/sources/severity_feature.hpp>#include <boost/log/utility/setup/common_attributes.hpp>#include <boost/log/sources/record_ostream.hpp>#include <boost/log/utility/setup/file.hpp>#include <unordered_map>Go to the source code of this file.
Namespaces | |
| namespace | fire::logging |
| Housing for logging infrastructure. | |
Macros | |
| #define | BOOST_ALL_DYN_LINK 1 |
| Necessary to get linking to work? More... | |
| #define | ENABLE_LOGGING(name) mutable logging::logger theLog_{logging::makeLogger(#name)}; |
| Enables logging in a class. More... | |
| #define | fire_log(lvl) BOOST_LOG_SEV(theLog_, fire::logging::level::lvl) |
| Log a message at the input level through fire. More... | |
Typedefs | |
| using | fire::logging::logger = log::sources::severity_channel_logger_mt< level, std::string > |
| Short names for boost::log. More... | |
Enumerations | |
| enum | fire::logging::level { fire::logging::debug = 0 , fire::logging::info , fire::logging::warn , fire::logging::error , fire::logging::fatal } |
| Different logging levels available to fire's log. More... | |
Functions | |
| level | fire::logging::convertLevel (int iLvl) |
| Convert an integer to the severity level enum. More... | |
| logger | fire::logging::makeLogger (const std::string &name) |
| Gets a logger for the user. More... | |
| void | fire::logging::open (const level termLevel, const level fileLevel, const std::string &fileName) |
| Initialize the logging backend. More... | |
| void | fire::logging::close () |
| Close up the logging. | |
Interface to Boost.Logging.
| #define ENABLE_LOGGING | ( | name | ) | mutable logging::logger theLog_{logging::makeLogger(#name)}; |
Enables logging in a class.
Should be put in the private section of the class and before the closing bracket };
Defines the member variable theLog_ with the input name as the channel name.
Makes theLog_ mutable so that the log can be used in any class function.
| [in] | name | Name of logging channel |
| #define fire_log | ( | lvl | ) | BOOST_LOG_SEV(theLog_, fire::logging::level::lvl) |
Log a message at the input level through fire.
Assumes to have access to a variable named theLog_ of type fire::logging::logger.
| [in] | lvl | logging level without namespace or enum (e.g. info) |