From e68759a4101567a27e306eae0a907baa759ae80c Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sun, 12 Nov 2017 22:30:20 +0000 Subject: Designing simple preview game --- yage/core/logger.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'yage/core/logger.h') diff --git a/yage/core/logger.h b/yage/core/logger.h index 6829327e..2c70fd04 100644 --- a/yage/core/logger.h +++ b/yage/core/logger.h @@ -9,23 +9,35 @@ #ifndef YAGE_CORE_LOGGER_H #define YAGE_CORE_LOGGER_H -#include "logmessage.h" +#include +#include namespace yage { +class LogMessage; +class LogSink; + class Logger { public: - LogMessage operator()(); + explicit Logger(); + + LogMessage operator()(const std::string &fileName, int lineNum); void flush(const LogMessage *msg); + void add(const LogSink &sink); + void remove(const LogSink &sink); + void clear(); static Logger &instance(); + +private: + std::vector sinks_; }; } // namespace yage -#define gLog yage::Logger::instance()() +#define gLog (yage::Logger::instance()(__FILE__, __LINE__)) #endif -- cgit