X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flogger.h;h=c22339f55928270dacadccc02fb2c27302b85b42;hb=HEAD;hp=3a10f0e89177e10c071b97cd389c79e4d46a1404;hpb=5e00719d0c63e306786ff36df61797cdbc86f3e9;p=builder.git diff --git a/source/logger.h b/source/logger.h deleted file mode 100644 index 3a10f0e..0000000 --- a/source/logger.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef LOGGER_H_ -#define LOGGER_H_ - -#include -#include -#include - -class Logger -{ -private: - std::vector enabled_channels; - -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 - void log(const std::string &, const std::string &, Args &&...) const; - -private: - void print(const std::string &) const; -}; - -template -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)...)); -} - -#endif