diff options
Diffstat (limited to 'project2/common/logger.cpp')
-rw-r--r-- | project2/common/logger.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/project2/common/logger.cpp b/project2/common/logger.cpp index 98aaf0b..64df516 100644 --- a/project2/common/logger.cpp +++ b/project2/common/logger.cpp @@ -2,7 +2,7 @@ #define SYSLOG_NAMES 1 // Enables the definition of names in syslog.h #include "logger.h" -#include "instanceStore.impl.h" +#include <factory.impl.h> Log Logger::log; @@ -17,7 +17,7 @@ Log::~Log() } void -Log::setLoggerAt(LogDriverLoader * ldr, int level) +Log::setLoggerAt(LogDriverFactory * ldr, int level) { if (level == -1) { logs.erase(ldr); @@ -26,9 +26,9 @@ Log::setLoggerAt(LogDriverLoader * ldr, int level) logs[ldr] = ldr->create(); } lowestLevel = -1; - for (const auto & log : InstanceSet<LogDriverLoader>::GetAll()) { - if (log->loggerLevel() > lowestLevel) { - lowestLevel = log->loggerLevel(); + for (const auto & log : AdHoc::PluginManager::getDefault()->getAll<LogDriverFactory>()) { + if (log->implementation()->loggerLevel() > lowestLevel) { + lowestLevel = log->implementation()->loggerLevel(); } } } @@ -102,5 +102,6 @@ LogDriverBase::~LogDriverBase() { } -INSTANTIATESTORE(std::string, LogDriverLoader); +template class AdHoc::Factory<LogDriverBase>; +INSTANTIATEPLUGINOF(LogDriverFactory) |