1 #ifndef LIBFILEZILLA_LOGGER_HEADER 2 #define LIBFILEZILLA_LOGGER_HEADER 31 debug_info = 1ull << 5,
32 debug_verbose = 1ull << 6,
33 debug_debug = 1ull << 7,
36 private1 = 1ull << 31,
37 private32 = 1ull << 63
63 template<
typename String,
typename...Args>
68 do_log(t, std::move(formatted));
73 template<
typename String>
77 std::wstring formatted =
fz::to_wstring(std::forward<String>(msg));
78 do_log(t, std::move(formatted));
112 std::atomic<uint64_t> level_{logmsg::status | logmsg::error | logmsg::command | logmsg::reply};
void set_all(logmsg::type t)
Sets which message types should be logged.
Definition: logger.hpp:87
std::string sprintf(std::string_view const &fmt, Args &&... args)
A simple type-safe sprintf replacement.
Definition: format.hpp:407
std::wstring to_wstring(std::string_view const &in)
Converts from std::string in system encoding into std::wstring.
virtual void do_log(logmsg::type t, std::wstring &&msg)=0
The one thing you need to override.
Replies, aimed at the users.
Definition: logger.hpp:27
Error messages aimed at the user.
Definition: logger.hpp:21
void enable(logmsg::type t)
Enables logging for the passed message types.
Definition: logger.hpp:102
Generic status messages aimed at the user.
Definition: logger.hpp:18
type
Definition: logger.hpp:15
void disable(logmsg::type t)
Disables logging for the passed message types.
Definition: logger.hpp:107
void log(logmsg::type t, String &&fmt, Args &&...args)
The.
Definition: logger.hpp:64
void log_raw(logmsg::type t, String &&msg)
Logs the raw string, it is not treated as format string.
Definition: logger.hpp:74
void set(logmsg::type t, bool flag)
Sets whether the given types should be logged.
Definition: logger.hpp:92
The namespace used by libfilezilla.
Definition: apply.hpp:17
Abstract interface for logging strings.
Definition: logger.hpp:49
Commands, aimed at the users.
Definition: logger.hpp:24
Debug messages aimed at developers.
Definition: logger.hpp:30