29#include <fmt/format.h>
62 bool write_log) noexcept
89 template <
typename... Args>
90 requires(
sizeof...(Args) > 0)
91 void operator()(fmt::format_string<Args...> format, Args&&... args)
const {
96 fmt::memory_buffer buffer;
98 std::back_inserter(buffer), format, std::forward<Args>(args)...);
100 std::string_view{buffer.data(), buffer.size()});
178 config_.output_log_level_in_child_iterations())),
180 config_.output_log_level_in_child_iterations())) {}
214 child.iteration_layer_handler_);
402 log_level level, std::string_view body)
const {
418 template <
typename... Args>
419 requires(
sizeof...(Args) > 0)
421 log_level level, fmt::format_string<Args...> format,
422 Args&&... args)
const {
423 fmt::memory_buffer buffer;
425 std::back_inserter(buffer), format, std::forward<Args>(args)...);
427 std::string_view(buffer.data(), buffer.size()));
Class to handle layers of iterations.
void set_iterative() const noexcept
Set this node to an iterative algorithm.
void initialize_lower_layer(iteration_layer_handler &lower_layer) noexcept
Initialize the lower layer.
auto is_upper_layer_iterative() const noexcept -> bool
Check whether one of upper layers is iterative.
Class to hold configurations for log tags.
auto sink() const noexcept -> const sinks::log_sink &
Get the log sink.
auto output_log_level_in_child_iterations() const noexcept -> log_level
Get the minimum log level to output in child iterations.
auto output_log_level() const noexcept -> log_level
Get the minimum log level to output.
Class of tags of logs without memory management.
auto name() const noexcept -> const std::string &
Get the name of this tag.
void log_without_condition_check(util::source_info_view source, log_level level, std::string_view body) const
Write a log without check of the condition to write logs.
logger(log_tag tag, log_tag_config config)
Constructor.
impl::iteration_layer_handler iteration_layer_handler_
Handler of layers of iterations.
log_tag_config config_
Configuration.
log_level lowest_output_log_level_
Lowest log level to output.
auto iteration_label(util::source_info_view source=util::source_info_view()) const noexcept -> logging_proxy
Write a label of iteration logs.
auto iteration(util::source_info_view source=util::source_info_view()) const noexcept -> logging_proxy
Write a iteration log.
auto trace(util::source_info_view source=util::source_info_view()) const noexcept -> logging_proxy
Write a trace log.
auto warning(util::source_info_view source=util::source_info_view()) const noexcept -> logging_proxy
Write a warning log.
auto summary(util::source_info_view source=util::source_info_view()) const noexcept -> logging_proxy
Write a summary log.
auto log(log_level level, util::source_info_view source=util::source_info_view()) const noexcept -> logging_proxy
Write a log.
void set_iterative() const noexcept
Set this node to an iterative algorithm.
void log_without_condition_check(util::source_info_view source, log_level level, fmt::format_string< Args... > format, Args &&... args) const
Write a log without check of the condition to write logs.
logger(log_tag_view tag)
Constructor.
log_level always_output_log_level_
Minimum log level to output always.
logger(log_tag_view tag, log_tag_config config)
Constructor.
auto info(util::source_info_view source=util::source_info_view()) const noexcept -> logging_proxy
Write a information log.
auto debug(util::source_info_view source=util::source_info_view()) const noexcept -> logging_proxy
Write a debug log.
auto critical(util::source_info_view source=util::source_info_view()) const noexcept -> logging_proxy
Write a critical log.
auto should_log(log_level level) const noexcept -> bool
Check whether to write logs with a log level.
auto error(util::source_info_view source=util::source_info_view()) const noexcept -> logging_proxy
Write a error log.
auto tag() const noexcept -> const log_tag &
Get the log tag.
auto config() const noexcept -> const log_tag_config &
Get the configuration.
void initialize_child_algorithm_logger(logger &child) noexcept
Initialize a logger as the logger of the algorithm called from the algorithm of this logger.
Proxy class to write logs.
bool write_log_
Whether to write log.
logging_proxy(std::string_view tag, log_level level, util::source_info_view source, const sinks::log_sink *sink, bool write_log) noexcept
Constructor.
util::source_info_view source_
Information of the source code.
log_level level_
Log level.
std::string_view tag_
Tag.
void operator()(std::string_view body) const
Write a log.
const sinks::log_sink * sink_
Log sink.
void write(time_stamp time, std::string_view tag, log_level level, util::source_info_view source, std::string_view body) const noexcept
Write a log.
static auto now() noexcept -> time_stamp
Get the current time stamp.
Class to hold information of source codes.
Definition of iteration_layer_handler class.
Definition of functions to get and set logging configurations.
Definition of log_level enumeration.
Definition of log_sink class.
Definition of log_tag class.
Definition of log_tag_config class.
Definition of log_tag_view class.
log_level
Enumeration of log levels.
@ iteration_label
Label of iterations.
NUM_COLLECT_EXPORT auto get_config_of(log_tag_view tag) -> log_tag_config
Get the configuration of a tag.
constexpr auto default_tag
Default log tag.
Definition of source_info_view class.
Definition of time_stamp class.