25#include "num_collect/impl/num_collect_export.h"
121 struct reference_count;
145template <
typename T,
typename... Args>
147 T* ptr =
new T(std::forward<Args>(args)...);
152 static_cast<T*
>(ptr)->write(time, tag, level, source, body);
154 [](
void* ptr)
noexcept {
delete static_cast<T*
>(ptr); });
log_sink(const log_sink &obj) noexcept
Copy constructor.
reference_count * reference_count_
Reference count.
void(*)(void *, time_stamp, std::string_view, log_level, util::source_info_view, std::string_view) noexcept write_function_type
Type of functions to write logs.
log_sink(log_sink &&obj) noexcept
Move constructor.
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.
void * user_data_
User data.
auto operator=(log_sink &&obj) noexcept -> log_sink &
Move assignment operator.
auto operator=(const log_sink &obj) noexcept -> log_sink &
Copy assignment operator.
log_sink(void *user_data, write_function_type write_function, finalizer_type finalizer)
Constructor.
write_function_type write_function_
Function to write logs.
finalizer_type finalizer_
Function to finalize the log sink.
void(*)(void *) noexcept finalizer_type
Type of functions to finalize the lgo sink.
Class to hold information of source codes.
Definition of log_level enumeration.
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.