libfilezilla
|
Abstract interface for logging strings. More...
#include <logger.hpp>
Public Member Functions | |
logger_interface (logger_interface const &)=delete | |
logger_interface & | operator= (logger_interface const &)=delete |
virtual void | do_log (logmsg::type t, std::wstring &&msg)=0 |
The one thing you need to override. | |
template<typename String , typename... Args> | |
void | log (logmsg::type t, String &&fmt, Args &&...args) |
template<typename String , typename... Args> | |
void | log_u (logmsg::type t, String &&fmt, Args const &...args) |
template<typename String > | |
void | log_raw (logmsg::type t, String &&msg) |
Logs the raw string, it is not treated as format string. | |
template<typename String > | |
void | log_u_raw (logmsg::type t, String &&msg) |
bool | should_log (logmsg::type t) const |
Is any of the passed log levels set. | |
logmsg::type | levels () const |
Returns all currently enabled log levels. | |
virtual void | set_all (logmsg::type t) |
Sets which message types should be logged. | |
void | set (logmsg::type t, bool flag) |
Sets whether the given types should be logged. | |
virtual void | enable (logmsg::type t) |
Enables logging for the passed message types. | |
virtual void | disable (logmsg::type t) |
Disables logging for the passed message types. | |
Protected Attributes | |
std::atomic< uint64_t > | level_ {logmsg::status | logmsg::error | logmsg::command | logmsg::reply} |
Abstract interface for logging strings.
Each log message has a type. Logging can be enabled or disabled for each type.
The actual string to log gets assembled from the format string and its arguments only if the type is supposed to be logged.
|
inline |
The
Assumes that all narrow string arguments are in the locale's current encoding.
|
inline |
The
Assumes that all narrow string arguments, excluding the format string, are in UTF-8