qxLib
Public Member Functions | List of all members
qx::logger Class Reference

Logger class. More...

#include <logger.h>

Inheritance diagram for qx::logger:
qx::logger_singleton

Public Member Functions

void log (verbosity eVerbosity, string_view svFormat, const category &category, string_view svFile, string_view svFunction, int nLine)
 Log to all streams. More...
 
template<class... args_t>
 requires (log_acceptable_args< args_t... >) void log(verbosity eVerbosity
 Log to all streams. More...
 
void flush ()
 Flush all streams.
 
void add_stream (std::unique_ptr< base_logger_stream > pStream) noexcept
 Add output stream to the logger. More...
 
void reset () noexcept
 Reset logger and clear all streams.
 
bool will_any_stream_accept (const category &category, verbosity eVerbosity, string_view svFile, string_view svFunction) const noexcept
 Returns true if any of streams will accept this message. More...
 

Detailed Description

Logger class.

~

Author
Khrapov
Date
10.01.2020

Definition at line 55 of file logger.h.

Member Function Documentation

◆ add_stream()

void qx::logger::add_stream ( std::unique_ptr< base_logger_stream pStream)
inlinenoexcept

Add output stream to the logger.

Parameters
pStream- stream unique pointer

Definition at line 47 of file logger.inl.

◆ log()

void qx::logger::log ( verbosity  eVerbosity,
string_view  svFormat,
const category category,
string_view  svFile,
string_view  svFunction,
int  nLine 
)
inline

Log to all streams.

Parameters
eVerbosity- message verbosity
svFormat- format string
category- code category
svFile- file name string
svFunction- function name string
nLine- code line number

Definition at line 13 of file logger.inl.

◆ requires()

template<class... args_t>
qx::logger::requires ( log_acceptable_args< args_t... >  )

Log to all streams.

Template Parameters
args_t- template parameter pack type
Parameters
eVerbosity- message verbosity
sFormat- format string
category- code category
svFile- file name string
svFunction- function name string
nLine- code line number
args- additional args for format

◆ will_any_stream_accept()

bool qx::logger::will_any_stream_accept ( const category category,
verbosity  eVerbosity,
string_view  svFile,
string_view  svFunction 
) const
inlinenoexcept

Returns true if any of streams will accept this message.

Typically you don't want to use it It may be useful with async logging to avoid unnecessary formatting and queueing

Parameters
category- code category
eVerbosity- message verbosity
svFile- file name string
svFunction- function name string
Return values
-true if any of streams will accept this message

Definition at line 57 of file logger.inl.


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