25 global_default_loglevel = level;
32 static std::array<einhard::Logger<>, std::tuple_size<LogArea::AreaTuple>::value>
49 template <
int index,
int stop = 0>
50 constexpr
typename std::enable_if<(index == stop), int>::type
52 using LogAreaTag =
typename std::remove_reference<decltype(
53 std::get<index>(std::declval<LogArea::AreaTuple &>()))>::type;
54 return LogAreaTag::textual_length();
68 template <
int index,
int stop = 0,
int mid = (index + stop) / 2>
69 constexpr
typename std::enable_if<(index > stop),
int>::type
71 return find_longest_logger_name<index, mid + 1>() >
72 find_longest_logger_name<mid, stop>()
73 ? find_longest_logger_name<index, mid + 1>()
74 : find_longest_logger_name<mid, stop>();
82 template <std::
size_t index,
int>
98 template <std::size_t index,
102 using LogAreaTag =
typename std::remove_reference<decltype(
103 std::get<index - 1>(std::declval<LogArea::AreaTuple &>()))>::type;
104 static_assert(LogAreaTag::id == index - 1,
105 "The order of types in LogArea::AreaTuple does not match the " 106 "id values in the LogArea types. Please fix! (see top of " 107 "'include/logging.h')");
112 config.
take({LogAreaTag::textual()}, global_default_loglevel));
117 create_all_loggers_impl<std::tuple_size<LogArea::AreaTuple>::value>(config);
void setAreaName(const char *name)
Set an area name.
std::enable_if<(index==0)>::type create_all_loggers_impl(Configuration &)
Interface to the SMASH configuration files.
einhard::LogLevel default_loglevel()
static std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > global_logger_collection
An array that stores all pre-configured Logger objects.
void create_all_loggers(Configuration config)
Called from main() right after the Configuration object is fully set up to create all logger objects ...
std::string fill_both(const std::string &s, size_t width, char fill= ' ')
Fill string with characters at both sides until the given width is reached.
Value take(std::initializer_list< const char * > keys)
The default interface for SMASH to read configuration values.
constexpr std::enable_if<(index==stop), int >::type find_longest_logger_name()
static einhard::LogLevel global_default_loglevel
The default logging level is ALL.
A Logger object can be used to output messages to stdout.
void set_default_loglevel(einhard::LogLevel level)
Set the default log level (what will be returned from subsequent default_loglevel calls)...
void setVerbosity(LogLevel verbosity) noexcept
Modify the verbosity of the Logger.
einhard::Logger & retrieve_logger_impl(int id)
LogLevel
Specification of the message severity.
einhard::Logger & logger()