summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2012-09-05 21:39:19 +0200
committerAndreas Baumann <abaumann@yahoo.com>2012-09-05 21:39:19 +0200
commita29c464aa72d46cc956ac2752a2518526c499716 (patch)
tree96eebb1fb5b0070d196e04db0b73486b39decc14 /include
parentdf2c44401f8dd736a903e73813e5f83fb15b36b6 (diff)
downloadcrawler-a29c464aa72d46cc956ac2752a2518526c499716.tar.gz
crawler-a29c464aa72d46cc956ac2752a2518526c499716.tar.bz2
started to solve the logger dll problem on Windows
Diffstat (limited to 'include')
-rwxr-xr-xinclude/logger/ConsoleLogSink.hpp2
-rwxr-xr-xinclude/logger/FileLogSink.hpp2
-rwxr-xr-xinclude/logger/LogSink.hpp3
-rwxr-xr-xinclude/logger/Logger.hpp29
-rwxr-xr-xinclude/logger/SyslogLogSink.hpp2
-rwxr-xr-xinclude/logger/WinDbgLogSink.hpp2
-rwxr-xr-x[-rw-r--r--]include/util/Exportable.hpp4
-rwxr-xr-x[-rw-r--r--]include/util/ScopedPtr.hpp0
8 files changed, 25 insertions, 19 deletions
diff --git a/include/logger/ConsoleLogSink.hpp b/include/logger/ConsoleLogSink.hpp
index f700825..0605fb8 100755
--- a/include/logger/ConsoleLogSink.hpp
+++ b/include/logger/ConsoleLogSink.hpp
@@ -8,7 +8,7 @@ class ConsoleLogSink : public LogSink
public:
ConsoleLogSink( const LogLevel level ) : LogSink( level ) { }
- void log( const LogLevel level, const std::string &msg );
+ DLL_EXPORT virtual void log( const LogLevel level, const std::string &msg );
};
#endif
diff --git a/include/logger/FileLogSink.hpp b/include/logger/FileLogSink.hpp
index f488a87..d8b1381 100755
--- a/include/logger/FileLogSink.hpp
+++ b/include/logger/FileLogSink.hpp
@@ -13,7 +13,7 @@ class FileLogSink : public LogSink
~FileLogSink( );
- void log( const LogLevel level, const std::string &msg );
+ DLL_EXPORT virtual void log( const LogLevel level, const std::string &msg );
private:
std::string m_filename;
diff --git a/include/logger/LogSink.hpp b/include/logger/LogSink.hpp
index 322e546..0cde9d4 100755
--- a/include/logger/LogSink.hpp
+++ b/include/logger/LogSink.hpp
@@ -1,6 +1,7 @@
#ifndef __LOGSINK_H
#define __LOGSINK_H
+#include "Exportable.hpp"
#include "Logger.hpp"
class LogSink
@@ -10,7 +11,7 @@ class LogSink
virtual ~LogSink( ) { }
- virtual void log( const LogLevel level, const std::string &msg ) = 0;
+ DLL_EXPORT virtual void log( const LogLevel level, const std::string &msg ) = 0;
void setReportingLevel( const LogLevel level ) { m_level = level; }
diff --git a/include/logger/Logger.hpp b/include/logger/Logger.hpp
index dc514ae..9a84f55 100755
--- a/include/logger/Logger.hpp
+++ b/include/logger/Logger.hpp
@@ -1,6 +1,7 @@
#ifndef __LOGGER_H
#define __LOGGER_H
+#include "Exportable.hpp"
#include "Singleton.hpp"
#include "ScopedPtr.hpp"
@@ -29,21 +30,21 @@ class Logger : public Singleton< Logger >
public:
DECLARE_SINGLETON( Logger )
- void addSink( LogSink *sink );
- void removeSink( LogSink *sink );
- void log( const LogLevel level, const std::string &msg );
+ DLL_EXPORT void addSink( LogSink *sink );
+ DLL_EXPORT void removeSink( LogSink *sink );
+ DLL_EXPORT void log( const LogLevel level, const std::string &msg );
- static std::string toString( const LogLevel level );
- static LogLevel fromString( const std::string &s );
+ DLL_EXPORT static std::string toString( const LogLevel level );
+ DLL_EXPORT static LogLevel fromString( const std::string &s );
- void openConsoleLog( const LogLevel level );
- void openFileLog( const LogLevel level, const std::string &filename );
- void openSyslog( const LogLevel level, const std::string &ident, const std::string &facility );
- void openWinDbgLog( const LogLevel level );
+ DLL_EXPORT void openConsoleLog( const LogLevel level );
+ DLL_EXPORT void openFileLog( const LogLevel level, const std::string &filename );
+ DLL_EXPORT void openSyslog( const LogLevel level, const std::string &ident, const std::string &facility );
+ DLL_EXPORT void openWinDbgLog( const LogLevel level );
protected:
- Logger( );
- virtual ~Logger( );
+ DLL_EXPORT Logger( );
+ DLL_EXPORT virtual ~Logger( );
private:
scopedPtr< LoggerImpl > m_impl;
@@ -54,9 +55,9 @@ DEFINE_SINGLETON( Logger )
class LogStream : private noncopyable, public std::ostringstream
{
public:
- LogStream( Logger &logger, const LogLevel level );
- ~LogStream( );
- std::ostream &get( );
+ DLL_EXPORT LogStream( Logger &logger, const LogLevel level );
+ DLL_EXPORT ~LogStream( );
+ DLL_EXPORT std::ostream &get( );
private:
LogStream( );
diff --git a/include/logger/SyslogLogSink.hpp b/include/logger/SyslogLogSink.hpp
index 64e52f1..af0e7ee 100755
--- a/include/logger/SyslogLogSink.hpp
+++ b/include/logger/SyslogLogSink.hpp
@@ -12,7 +12,7 @@ class SyslogLogSink : public LogSink
~SyslogLogSink( );
- void log( const LogLevel level, const std::string &msg );
+ DLL_EXPORT virtual void log( const LogLevel level, const std::string &msg );
static int levelToSyslogLevel( const LogLevel level );
static int facilityFromString( const std::string &facility );
diff --git a/include/logger/WinDbgLogSink.hpp b/include/logger/WinDbgLogSink.hpp
index f7caa86..67e13e7 100755
--- a/include/logger/WinDbgLogSink.hpp
+++ b/include/logger/WinDbgLogSink.hpp
@@ -8,7 +8,7 @@ class WinDbgLogSink : public LogSink
public:
WinDbgLogSink( const LogLevel level ) : LogSink( level ) { }
- void log( const LogLevel level, const std::string &msg );
+ DLL_EXPORT virtual void log( const LogLevel level, const std::string &msg );
};
#endif
diff --git a/include/util/Exportable.hpp b/include/util/Exportable.hpp
index 28ac7ff..a676ae3 100644..100755
--- a/include/util/Exportable.hpp
+++ b/include/util/Exportable.hpp
@@ -6,8 +6,12 @@
#define SINGLETON_EXPORT
#define SINGLETON_EXTERN
+#define DLL_EXPORT
+
#else
+#define DLL_EXPORT __declspec(dllexport)
+
#ifndef SHARED
#define SINGLETON_EXPORT __declspec(dllexport)
#define SINGLETON_EXTERN
diff --git a/include/util/ScopedPtr.hpp b/include/util/ScopedPtr.hpp
index 19a41d2..19a41d2 100644..100755
--- a/include/util/ScopedPtr.hpp
+++ b/include/util/ScopedPtr.hpp