numerical-collection-cpp 0.10.0
A collection of algorithms in numerical analysis implemented in C++
Loading...
Searching...
No Matches
num_collect::logging::sinks::combined_log_sink Class Reference

Class of log sinks to write logs to multiple log sinks. More...

#include <num_collect/logging/sinks/combined_log_sink.h>

+ Collaboration diagram for num_collect::logging::sinks::combined_log_sink:

Public Member Functions

 combined_log_sink (combined_log_sink &&)=delete
 
 combined_log_sink (const combined_log_sink &)=delete
 
 combined_log_sink (std::vector< std::pair< log_sink, log_level > > sinks)
 Constructor.
 
 ~combined_log_sink ()=default
 Destructor.
 
auto operator= (combined_log_sink &&) -> combined_log_sink &=delete
 
auto operator= (const combined_log_sink &) -> combined_log_sink &=delete
 
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.
 

Private Attributes

std::vector< std::pair< log_sink, log_level > > sinks_
 Log sinks with log levels.
 

Detailed Description

Class of log sinks to write logs to multiple log sinks.

Thread Safety
Thread-safe for all operations.

Definition at line 38 of file combined_log_sink.h.

Constructor & Destructor Documentation

◆ combined_log_sink()

num_collect::logging::sinks::combined_log_sink::combined_log_sink ( std::vector< std::pair< log_sink, log_level > > sinks)
inlineexplicit

Constructor.

Parameters
[in]sinksLog sinks with log levels.

Definition at line 45 of file combined_log_sink.h.

Member Function Documentation

◆ write()

void num_collect::logging::sinks::combined_log_sink::write ( time_stamp time,
std::string_view tag,
log_level level,
util::source_info_view source,
std::string_view body )
inlinenoexcept

Write a log.

Parameters
[in]timeTime.
[in]tagTag.
[in]levelLog level.
[in]sourceInformation of the source code.
[in]bodyLog body.
Note
This function can be called from multiple threads.

Definition at line 70 of file combined_log_sink.h.

Member Data Documentation

◆ sinks_

std::vector<std::pair<log_sink, log_level> > num_collect::logging::sinks::combined_log_sink::sinks_
private

Log sinks with log levels.

Definition at line 81 of file combined_log_sink.h.


The documentation for this class was generated from the following file: