6 #include <msp/strings/format.h>
7 #include "libbuilder_api.h"
9 class LIBBUILDER_API Logger
12 std::vector<std::string> enabled_channels;
15 void enable_channel(const std::string &);
16 void disable_channel(const std::string &);
17 bool is_channel_enabled(const std::string &) const;
19 void log(const std::string &, const std::string &) const;
21 template<typename... Args>
22 void log(const std::string &, const std::string &, Args &&...) const;
25 void print(const std::string &) const;
28 template<typename... Args>
29 void Logger::log(const std::string &chan, const std::string &fmt, Args &&... args) const
31 if(is_channel_enabled(chan))
32 print(Msp::format(fmt, std::forward<Args>(args)...));