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

Proxy class to write logs. More...

#include <num_collect/logging/logger.h>

+ Collaboration diagram for num_collect::logging::logging_proxy:

Public Member Functions

 logging_proxy (std::string_view tag, log_level level, util::source_info_view source, const sinks::log_sink *sink, bool write_log) noexcept
 Constructor.
 
template<typename... Args>
requires (sizeof...(Args) > 0)
void operator() (fmt::format_string< Args... > format, Args &&... args) const
 Write a log.
 
void operator() (std::string_view body) const
 Write a log.
 

Private Attributes

log_level level_
 Log level.
 
const sinks::log_sinksink_
 Log sink.
 
util::source_info_view source_
 Information of the source code.
 
std::string_view tag_
 Tag.
 
bool write_log_
 Whether to write log.
 

Detailed Description

Proxy class to write logs.

Warning
This class is assumed to be used only as an temporary object returned from num_collect::logging::logger class.

Definition at line 49 of file logger.h.

Constructor & Destructor Documentation

◆ logging_proxy()

num_collect::logging::logging_proxy::logging_proxy ( std::string_view tag,
log_level level,
util::source_info_view source,
const sinks::log_sink * sink,
bool write_log )
inlinenoexcept

Constructor.

Parameters
[in]tagTag.
[in]levelLog level.
[in]sourceInformation of the source code.
[in]sinkLog sink.
[in]write_logWhether to write log.

Definition at line 60 of file logger.h.

Member Function Documentation

◆ operator()() [1/2]

template<typename... Args>
requires (sizeof...(Args) > 0)
void num_collect::logging::logging_proxy::operator() ( fmt::format_string< Args... > format,
Args &&... args ) const
inline

Write a log.

Template Parameters
ArgsType of arguments.
Parameters
[in]formatFormat string.
[in]argsArguments for the format string.

Definition at line 91 of file logger.h.

◆ operator()() [2/2]

void num_collect::logging::logging_proxy::operator() ( std::string_view body) const
inline

Write a log.

Parameters
[in]bodyBody.

Definition at line 74 of file logger.h.

Member Data Documentation

◆ level_

log_level num_collect::logging::logging_proxy::level_
private

Log level.

Definition at line 108 of file logger.h.

◆ sink_

const sinks::log_sink* num_collect::logging::logging_proxy::sink_
private

Log sink.

Definition at line 114 of file logger.h.

◆ source_

util::source_info_view num_collect::logging::logging_proxy::source_
private

Information of the source code.

Definition at line 111 of file logger.h.

◆ tag_

std::string_view num_collect::logging::logging_proxy::tag_
private

Tag.

Definition at line 105 of file logger.h.

◆ write_log_

bool num_collect::logging::logging_proxy::write_log_
private

Whether to write log.

Definition at line 117 of file logger.h.


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