1 #ifndef LIBFILEZILLA_LOGGER_HEADER
2 #define LIBFILEZILLA_LOGGER_HEADER
26 debug_warning = 1ull << 4,
27 debug_info = 1ull << 5,
28 debug_verbose = 1ull << 6,
29 debug_debug = 1ull << 7,
32 private1 = 1ull << 31,
33 private32 = 1ull << 63
48 virtual void do_log(logmsg::type t, std::wstring && msg) = 0;
50 template<
typename String,
typename...Args>
51 void log(logmsg::type t, String&& fmt, Args&& ...args)
55 do_log(t, std::move(formatted));
59 template<
typename String>
60 void log_raw(logmsg::type t, String&& msg)
63 std::wstring formatted =
fz::to_wstring(std::forward<String>(msg));
64 do_log(t, std::move(formatted));
68 bool should_log(logmsg::type t)
const {
72 void set_all(logmsg::type t) {
76 void set(logmsg::type t,
bool flag) {
85 void enable(logmsg::type t) {
88 void disable(logmsg::type t) {
94 std::atomic<uint64_t> level_{logmsg::status | logmsg::error | logmsg::command | logmsg::reply};
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.
std::string sprintf(std::string_view const &fmt, Args &&...args)
A simple type-safe sprintf replacement.
Definition: format.hpp:406
The namespace used by libfilezilla.
Definition: apply.hpp:16
Definition: logger.hpp:37