fire v0.19.0
Framework for sImulation and Reconstruction of Events
Logger.h File Reference

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>
Include dependency graph for Logger.h:
This graph shows which files directly or indirectly include this file:

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.
 

Detailed Description

Interface to Boost.Logging.

Macro Definition Documentation

◆ BOOST_ALL_DYN_LINK

#define BOOST_ALL_DYN_LINK   1

Necessary to get linking to work?

References

◆ ENABLE_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.

Parameters
[in]nameName of logging channel

◆ fire_log

#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.

Parameters
[in]lvllogging level without namespace or enum (e.g. info)