From 5fd176606c251529c9d54054ed04b9716e6ae25e Mon Sep 17 00:00:00 2001 From: "RALOVICH, Kristóf" Date: Tue, 26 Mar 2013 16:52:28 +0100 Subject: use centralized logging in more places --- src/Log.hpp | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'src/Log.hpp') diff --git a/src/Log.hpp b/src/Log.hpp index 678c4b8..b5c08e1 100644 --- a/src/Log.hpp +++ b/src/Log.hpp @@ -99,7 +99,7 @@ namespace antpm , public LazySingleton { protected: - inline Log(const char* logFileName); + inline Log(const char* logFileName = NULL); public: inline virtual ~Log(); @@ -289,32 +289,41 @@ namespace antpm return (int)s.length(); } - template<> - inline - Log* - ClassInstantiator::instantiate() - { - return new Log("antpm.txt"); - } - - template<> - template<> - inline - Log* - ClassInstantiator::instantiate(const char* p1) - { - return new Log(p1); - } +// template<> +// inline +// Log* +// ClassInstantiator::instantiate() +// { +// return new Log("antpm.txt"); +// } + +// template<> +// template<> +// inline +// Log* +// ClassInstantiator::instantiate(const char* p1) +// { +// return new Log(p1); +// } /** * Start a log line. */ +#ifdef _MSC_VER #define lprintf(level, format, ...) \ if(level > psoLogMaxLogLevel) \ {} \ else if(level > antpm::Log::instance()->getLogReportingLevel()) \ {} \ else antpm::Log::instance()->lprintf2(level, format, __VA_ARGS__) +#else // GCC +#define lprintf(level, format, ...) \ + if(level > psoLogMaxLogLevel) \ + {} \ + else if(level > antpm::Log::instance()->getLogReportingLevel()) \ + {} \ + else antpm::Log::instance()->lprintf2(level, format, ##__VA_ARGS__) +#endif #define LOG(level) \ if(level > psoLogMaxLogLevel) \ -- cgit v1.2.3