Logger interface.
More...
#include <logger.h>
|
| | Logger () |
| | Initialize default logger.
|
| |
| | Logger (const std::string &name) |
| | Initialize named logger.
|
| |
| | Logger (const Logger &)=default |
| |
| | Logger (Logger &&)=default |
| |
| | ~Logger () |
| |
| Logger & | operator= (const Logger &)=default |
| |
| Logger & | operator= (Logger &&)=default |
| |
| void | Debug (std::string_view message) const |
| | Log debug message.
|
| |
| template<typename... T> |
| void | Debug (fmt::format_string< T... > message, T &&... args) const |
| | Log debug message with format arguments.
|
| |
| void | Info (std::string_view message) const |
| | Log information message.
|
| |
| template<typename... T> |
| void | Info (fmt::format_string< T... > message, T &&... args) const |
| | Log information message with format arguments.
|
| |
| void | Warn (std::string_view message) const |
| | Log warning message.
|
| |
| template<typename... T> |
| void | Warn (fmt::format_string< T... > message, T &&... args) const |
| | Log warning message with format arguments.
|
| |
| void | Error (std::string_view message) const |
| | Log error message.
|
| |
| template<typename... T> |
| void | Error (fmt::format_string< T... > message, T &&... args) const |
| | Log error message with format arguments.
|
| |
| void | Fatal (std::string_view message) const |
| | Log fatal message.
|
| |
| template<typename... T> |
| void | Fatal (fmt::format_string< T... > message, T &&... args) const |
| | Log fatal message with format arguments.
|
| |
| void | Flush () |
| | Flush the current logger.
|
| |
| void | Update () |
| | Update the current logger sink by taking the most recent one from configuration.
|
| |
Logger interface.
Logger is a main interface to produce logging records with a desired level.
Thread-safe or not thread-safe depends on the current logging sink.
- Examples
- async.cpp, console.cpp, default.cpp, file.cpp, format.cpp, sync.cpp, and syslog.cpp.
Definition at line 22 of file logger.h.
◆ Logger() [1/4]
| CppLogging::Logger::Logger |
( |
| ) |
|
Initialize default logger.
Definition at line 15 of file logger.cpp.
◆ Logger() [2/4]
| CppLogging::Logger::Logger |
( |
const std::string & |
name | ) |
|
|
explicit |
Initialize named logger.
- Parameters
-
Definition at line 19 of file logger.cpp.
◆ Logger() [3/4]
| CppLogging::Logger::Logger |
( |
const Logger & |
| ) |
|
|
default |
◆ Logger() [4/4]
| CppLogging::Logger::Logger |
( |
Logger && |
| ) |
|
|
default |
◆ ~Logger()
| CppLogging::Logger::~Logger |
( |
| ) |
|
|
inline |
◆ Debug() [1/2]
template<typename... T>
| void CppLogging::Logger::Debug |
( |
fmt::format_string< T... > |
message, |
|
|
T &&... |
args |
|
) |
| const |
|
inline |
Log debug message with format arguments.
Will log only in debug mode!
- Parameters
-
| message | - Debug message |
| args | - Format arguments |
Definition at line 56 of file logger.inl.
◆ Debug() [2/2]
| void CppLogging::Logger::Debug |
( |
std::string_view |
message | ) |
const |
|
inline |
◆ Error() [1/2]
template<typename... T>
| void CppLogging::Logger::Error |
( |
fmt::format_string< T... > |
message, |
|
|
T &&... |
args |
|
) |
| const |
|
inline |
Log error message with format arguments.
- Parameters
-
| message | - Error message |
| args | - Format arguments |
Definition at line 78 of file logger.inl.
◆ Error() [2/2]
| void CppLogging::Logger::Error |
( |
std::string_view |
message | ) |
const |
|
inline |
◆ Fatal() [1/2]
template<typename... T>
| void CppLogging::Logger::Fatal |
( |
fmt::format_string< T... > |
message, |
|
|
T &&... |
args |
|
) |
| const |
|
inline |
Log fatal message with format arguments.
- Parameters
-
| message | - Fatal message |
| args | - Format arguments |
Definition at line 84 of file logger.inl.
◆ Fatal() [2/2]
| void CppLogging::Logger::Fatal |
( |
std::string_view |
message | ) |
const |
|
inline |
◆ Flush()
| void CppLogging::Logger::Flush |
( |
| ) |
|
|
inline |
Flush the current logger.
Definition at line 89 of file logger.inl.
◆ Info() [1/2]
template<typename... T>
| void CppLogging::Logger::Info |
( |
fmt::format_string< T... > |
message, |
|
|
T &&... |
args |
|
) |
| const |
|
inline |
Log information message with format arguments.
- Parameters
-
| message | - Information message |
| args | - Format arguments |
Definition at line 66 of file logger.inl.
◆ Info() [2/2]
| void CppLogging::Logger::Info |
( |
std::string_view |
message | ) |
const |
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ Update()
| void CppLogging::Logger::Update |
( |
| ) |
|
Update the current logger sink by taking the most recent one from configuration.
Definition at line 23 of file logger.cpp.
◆ Warn() [1/2]
template<typename... T>
| void CppLogging::Logger::Warn |
( |
fmt::format_string< T... > |
message, |
|
|
T &&... |
args |
|
) |
| const |
|
inline |
Log warning message with format arguments.
- Parameters
-
| message | - Warning message |
| args | - Format arguments |
Definition at line 72 of file logger.inl.
◆ Warn() [2/2]
| void CppLogging::Logger::Warn |
( |
std::string_view |
message | ) |
const |
|
inline |
◆ Config
The documentation for this class was generated from the following files: