Class of log sinks.
More...
#include <num_collect/logging/sinks/log_sink.h>
Class of log sinks.
- Note
- This class holds pointers passed to the constructor and their reference count as in std::shared_ptr. A finalizer is called when the reference count comes to zero.
Definition at line 39 of file log_sink.h.
◆ finalizer_type
Type of functions to finalize the lgo sink.
The argument is the user data given in the constructor.
Definition at line 58 of file log_sink.h.
◆ write_function_type
Initial value: void (*)(void* ,
util::source_info_view , std::string_view ) noexcept
log_level
Enumeration of log levels.
Type of functions to write logs.
The first argument is the user data given in the constructor. The other arguments are the same as the arguments of write().
- Note
- This function is assumed to be thread-safe.
Definition at line 49 of file log_sink.h.
◆ log_sink() [1/3]
Constructor.
- Parameters
-
[in] | user_data | User data. |
[in] | write_function | Function to write logs. |
[in] | finalizer | Function to finalize the log sink. |
◆ log_sink() [2/3]
num_collect::logging::sinks::log_sink::log_sink |
( |
const log_sink & | obj | ) |
|
|
noexcept |
Copy constructor.
- Parameters
-
[in] | obj | Object to copy from. |
◆ log_sink() [3/3]
num_collect::logging::sinks::log_sink::log_sink |
( |
log_sink && | obj | ) |
|
|
noexcept |
Move constructor.
- Parameters
-
[in] | obj | Object to move from. |
◆ operator=() [1/2]
auto num_collect::logging::sinks::log_sink::operator= |
( |
const log_sink & | obj | ) |
-> log_sink & |
|
noexcept |
Copy assignment operator.
- Parameters
-
[in] | obj | Object to copy from. |
- Returns
- This object.
◆ operator=() [2/2]
auto num_collect::logging::sinks::log_sink::operator= |
( |
log_sink && | obj | ) |
-> log_sink & |
|
noexcept |
Move assignment operator.
- Parameters
-
[in] | obj | Object to move from. |
- Returns
- This object.
◆ write()
Write a log.
- Parameters
-
[in] | time | Time. |
[in] | tag | Tag. |
[in] | level | Log level. |
[in] | source | Information of the source code. |
[in] | body | Log body. |
- Note
- This function can be called from multiple threads.
◆ finalizer_
Function to finalize the log sink.
Definition at line 130 of file log_sink.h.
◆ reference_count_
reference_count* num_collect::logging::sinks::log_sink::reference_count_ |
|
private |
◆ user_data_
void* num_collect::logging::sinks::log_sink::user_data_ |
|
private |
◆ write_function_
Function to write logs.
Definition at line 127 of file log_sink.h.
The documentation for this class was generated from the following file: