fire v0.19.0
Framework for sImulation and Reconstruction of Events
|
Housing for logging infrastructure. More...
Typedefs | |
using | logger = log::sources::severity_channel_logger_mt< level, std::string > |
Short names for boost::log. More... | |
Enumerations | |
enum | level { debug = 0 , info , warn , error , fatal } |
Different logging levels available to fire's log. More... | |
Functions | |
level | convertLevel (int iLvl) |
Convert an integer to the severity level enum. More... | |
logger | makeLogger (const std::string &name) |
Gets a logger for the user. More... | |
void | open (const level termLevel, const level fileLevel, const std::string &fileName) |
Initialize the logging backend. More... | |
void | close () |
Close up the logging. | |
template<typename InputType , std::enable_if_t< std::is_convertible_v< InputType, level > > > | |
std::string | print (InputType severity_level) |
Severity level to human readable name map. More... | |
Housing for logging infrastructure.
This namespace holds the functions that allow fire to interact with boost's central logging framework in a helpful way.
using fire::logging::logger = typedef log::sources::severity_channel_logger_mt<level, std::string> |
Short names for boost::log.
short name for boost::log::sinks Define the type of logger we will be using in fire
We choose a logger that allows us to define a severity/logging level, has different "channels" for the log, and is multi-thread capable.
enum fire::logging::level |
level fire::logging::convertLevel | ( | int | iLvl | ) |
Convert an integer to the severity level enum.
Any integer below zero will be set to 0 (debug), and any integer above four will be set to 4 (fatal).
[in] | iLvl | integer level to be converted |
logger fire::logging::makeLogger | ( | const std::string & | name | ) |
Gets a logger for the user.
Returns a logger type with some extra initialization procedures done. Should only be called ONCE during a run.
name | name of this logging channel (e.g. processor name) |
void fire::logging::open | ( | const level | termLevel, |
const level | fileLevel, | ||
const std::string & | fileName | ||
) |
Initialize the logging backend.
This function setups up the terminal and file sinks. Sets their format and filtering level for this run.
termLevel | minimum level to print to terminal (everything above it is also printed) |
fileLevel | minimum level to print to file log (everything above it is also printed) |
fileName | name of file to print log to |
std::string fire::logging::print | ( | InputType | severity_level | ) |
Severity level to human readable name map.
Human readable names are the same width in characters
We could also add terminal color here if we wanted.
This function will only compile with values that can be implicity converted to a 'level'.
extract
method, so this function is currently not in use.