46 std::vector<std::pair<log_sink, log_level>> sinks)
72 for (
const auto& [sink, output_log_level] :
sinks_) {
73 if (level >= output_log_level) {
74 sink.write(time, tag, level, source, body);
81 std::vector<std::pair<log_sink, log_level>>
sinks_;
91 std::vector<std::pair<log_sink, log_level>> sinks) ->
log_sink {
Class of log sinks to write logs to multiple log sinks.
combined_log_sink(std::vector< std::pair< log_sink, log_level > > sinks)
Constructor.
~combined_log_sink()=default
Destructor.
std::vector< std::pair< log_sink, log_level > > sinks_
Log sinks with log levels.
void write(time_stamp time, std::string_view tag, log_level level, util::source_info_view source, std::string_view body) noexcept
Write a log.
Class to hold information of source codes.
Definition of log_level enumeration.
Definition of log_sink class.
auto create_combined_log_sink(std::vector< std::pair< log_sink, log_level > > sinks) -> log_sink
Create a log sink to write logs to multiple log sinks.
auto create_log_sink(Args &&... args) -> log_sink
Create a log sink.
log_level
Enumeration of log levels.
Definition of source_info_view class.
Definition of time_stamp class.