summaryrefslogtreecommitdiff
path: root/src/Log.hpp
diff options
context:
space:
mode:
authorRALOVICH, Kristóf <tade60@freemail.hu>2013-03-26 16:52:28 +0100
committerRALOVICH, Kristóf <tade60@freemail.hu>2013-03-26 16:52:28 +0100
commit5fd176606c251529c9d54054ed04b9716e6ae25e (patch)
tree7975bcd8c53702179e2169fe512d1b4e65bdf7e5 /src/Log.hpp
parent3b50f43ce0937bb6f4440f08f604235c719f820a (diff)
use centralized logging in more places
Diffstat (limited to 'src/Log.hpp')
-rw-r--r--src/Log.hpp43
1 files changed, 26 insertions, 17 deletions
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<Log, Log>
{
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<Log>::instantiate()
- {
- return new Log("antpm.txt");
- }
-
- template<>
- template<>
- inline
- Log*
- ClassInstantiator<Log>::instantiate<const char*>(const char* p1)
- {
- return new Log(p1);
- }
+// template<>
+// inline
+// Log*
+// ClassInstantiator<Log>::instantiate()
+// {
+// return new Log("antpm.txt");
+// }
+
+// template<>
+// template<>
+// inline
+// Log*
+// ClassInstantiator<Log>::instantiate<const char*>(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) \