aboutsummaryrefslogtreecommitdiff
path: root/src/common/Logging
diff options
context:
space:
mode:
authorNaios <naios-dev@live.de>2016-03-11 15:50:17 +0100
committerNaios <naios-dev@live.de>2016-03-11 18:22:39 +0100
commit5c91586797f199259567629a1d4d3f987c73e53c (patch)
tree0b6a484caf9dfa75d88d14aeb78e9d82da8c87d0 /src/common/Logging
parentf123c396591ffb50fa7e02365235740df618f579 (diff)
Core/Common: Move singleton instances into compilation units
* Fixes issues when building shared libraries (prevents gcc and clang from providing several instance)
Diffstat (limited to 'src/common/Logging')
-rw-r--r--src/common/Logging/Log.cpp6
-rw-r--r--src/common/Logging/Log.h6
2 files changed, 7 insertions, 5 deletions
diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp
index dff0351d52d..b350a41b482 100644
--- a/src/common/Logging/Log.cpp
+++ b/src/common/Logging/Log.cpp
@@ -321,6 +321,12 @@ void Log::Close()
appenders.clear();
}
+Log* Log::instance()
+{
+ static Log instance;
+ return &instance;
+}
+
void Log::Initialize(boost::asio::io_service* ioService)
{
if (ioService)
diff --git a/src/common/Logging/Log.h b/src/common/Logging/Log.h
index eafd7412a94..062f14d525c 100644
--- a/src/common/Logging/Log.h
+++ b/src/common/Logging/Log.h
@@ -44,11 +44,7 @@ class Log
public:
- static Log* instance()
- {
- static Log instance;
- return &instance;
- }
+ static Log* instance();
void Initialize(boost::asio::io_service* ioService);
void SetSynchronous(); // Not threadsafe - should only be called from main() after all threads are joined