#include <string>
#include <vector>
+#include <msp/strings/format.h>
class Logger
{
public:
void enable_channel(const std::string &);
void disable_channel(const std::string &);
+ bool is_channel_enabled(const std::string &) const;
void log(const std::string &, const std::string &) const;
+
+ template<typename... Args>
+ void log(const std::string &, const std::string &, Args &&...) const;
+
+private:
+ void print(const std::string &) const;
};
+template<typename... Args>
+void Logger::log(const std::string &chan, const std::string &fmt, Args &&... args) const
+{
+ if(is_channel_enabled(chan))
+ print(Msp::format(fmt, std::forward<Args>(args)...));
+}
+
#endif