Class to write logs.
More...
#include <msgpack_rpc/logging/logger.h>
Class to write logs.
- Note
- This class is assumed to be used in the following logging macros.
Definition at line 54 of file logger.h.
◆ Logger()
msgpack_rpc::logging::Logger::Logger |
( |
std::shared_ptr< ILogSink > | sink, |
|
|
LogLevel | output_log_level ) |
|
inline |
Constructor.
- Parameters
-
[in] | sink | Log sink. |
[in] | output_log_level | Log level to write logs. |
Definition at line 87 of file logger.h.
◆ create() [1/2]
◆ create() [2/2]
Create a logger.
- Parameters
-
[in] | sink | Log sink. |
[in] | output_log_level | Log level to write logs. |
- Returns
- Logger.
Definition at line 75 of file logger.h.
◆ output_log_level()
LogLevel msgpack_rpc::logging::Logger::output_log_level |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Get the log level to write logs.
- Returns
- Log level.
Definition at line 134 of file logger.h.
◆ write() [1/2]
Write a log.
- Template Parameters
-
Body | Type of the body of the log. (Must be convertible to std::string_view.) |
- Parameters
-
[in] | location | Location in source codes. |
[in] | level | Log level. |
[in] | body | Body of the log. |
Definition at line 100 of file logger.h.
◆ write() [2/2]
template<typename... Args>
void msgpack_rpc::logging::Logger::write |
( |
SourceLocationView | location, |
|
|
LogLevel | level, |
|
|
fmt::format_string< Args... > | format, |
|
|
Args &&... | args ) |
|
inline |
Write a log with formatting.
- Template Parameters
-
Args | Type of arguments of the format of the body. |
- Parameters
-
[in] | location | Location in source codes. |
[in] | level | Log level. |
[in] | format | Format of the body. |
[in] | args | Arguments of the format of the body. |
Definition at line 118 of file logger.h.
◆ output_log_level_
LogLevel msgpack_rpc::logging::Logger::output_log_level_ |
|
private |
◆ sink_
std::shared_ptr<ILogSink> msgpack_rpc::logging::Logger::sink_ |
|
private |
The documentation for this class was generated from the following file: