Interface to implement new logger mechanisms.
More...
#include <logger.hpp>
|
| sink () |
|
virtual | ~sink ()=default |
|
auto | is_verbose () const noexcept -> bool |
|
void | set_verbose (bool mode) noexcept |
|
void | set_filter (filter &filter) noexcept |
|
auto | info (std::string_view category, std::string_view component) -> logger |
|
template<typename Loggable > |
auto | info (const Loggable &loggable) -> logger |
|
auto | warning (std::string_view category, std::string_view component) -> logger |
|
template<typename Loggable > |
auto | warning (const Loggable &loggable) -> logger |
|
auto | debug (std::string_view category, std::string_view component) -> logger |
|
template<typename Loggable > |
auto | debug (const Loggable &loggable) -> logger |
|
Interface to implement new logger mechanisms.
Derive from this class and implement write_info, write_warning and write_debug functions.
- See also
- file_sink
-
console_sink
-
syslog_sink
-
silent_sink
◆ sink()
irccd::daemon::logger::sink::sink |
( |
| ) |
|
◆ ~sink()
virtual irccd::daemon::logger::sink::~sink |
( |
| ) |
|
|
virtualdefault |
Virtual destructor defaulted.
◆ debug() [1/2]
template<typename Loggable >
auto irccd::daemon::logger::sink::debug |
( |
const Loggable & |
loggable | ) |
-> logger
|
|
inline |
Convenient function with loggable objects.
- Parameters
-
loggable | the loggable object |
- Returns
- the output stream
- See also
- type_traits
◆ debug() [2/2]
auto irccd::daemon::logger::sink::debug |
( |
std::string_view |
category, |
|
|
std::string_view |
component |
|
) |
| -> logger |
Get the stream for debug messages.
If message is specified, a new line character is appended.
- Parameters
-
category | the category subsystem |
component | the optional component |
- Returns
- the output stream
- Note
- Has no effect if compiled in release mode.
◆ info() [1/2]
template<typename Loggable >
auto irccd::daemon::logger::sink::info |
( |
const Loggable & |
loggable | ) |
-> logger
|
|
inline |
Convenient function with loggable objects.
- Parameters
-
loggable | the loggable object |
- Returns
- the output stream
- See also
- type_traits
◆ info() [2/2]
auto irccd::daemon::logger::sink::info |
( |
std::string_view |
category, |
|
|
std::string_view |
component |
|
) |
| -> logger |
Get the stream for informational messages.
If message is specified, a new line character is appended.
- Parameters
-
category | the category subsystem |
component | the optional component |
- Returns
- the output stream
- Note
- Has no effect if verbose is set to false.
◆ is_verbose()
auto irccd::daemon::logger::sink::is_verbose |
( |
| ) |
const -> bool |
|
noexcept |
Tells if logger is verbose.
- Returns
- true if verbose
◆ set_filter()
void irccd::daemon::logger::sink::set_filter |
( |
filter & |
filter | ) |
|
|
noexcept |
Set an optional filter.
- Parameters
-
◆ set_verbose()
void irccd::daemon::logger::sink::set_verbose |
( |
bool |
mode | ) |
|
|
noexcept |
Set the verbosity mode.
- Parameters
-
◆ warning() [1/2]
template<typename Loggable >
auto irccd::daemon::logger::sink::warning |
( |
const Loggable & |
loggable | ) |
-> logger
|
|
inline |
Convenient function with loggable objects.
- Parameters
-
loggable | the loggable object |
- Returns
- the output stream
- See also
- type_traits
◆ warning() [2/2]
auto irccd::daemon::logger::sink::warning |
( |
std::string_view |
category, |
|
|
std::string_view |
component |
|
) |
| -> logger |
Get the stream for warnings.
If message is specified, a new line character is appended.
- Parameters
-
category | the category subsystem |
component | the optional component |
- Returns
- the output stream
◆ write_debug()
virtual void irccd::daemon::logger::sink::write_debug |
( |
const std::string & |
line | ) |
|
|
protectedpure virtual |
◆ write_info()
virtual void irccd::daemon::logger::sink::write_info |
( |
const std::string & |
line | ) |
|
|
protectedpure virtual |
◆ write_warning()
virtual void irccd::daemon::logger::sink::write_warning |
( |
const std::string & |
line | ) |
|
|
protectedpure virtual |
◆ logger
The documentation for this class was generated from the following file: