g3log/g2log/test_unit/tester_sharedlib.cpp
KjellKod f5438d8232 Thanks to Rajesh to push for g3log support for "runtime loading of dynamic libraries" (that will use g3log, initiated in main)
Thanks to Dmitry (d-led) for this working proof-of-concept of this at: https://github.com/d-led/g2log-dll

--HG--
rename : g2log/src/g2LogMessageBuilder.cpp => g2log/src/g2logmessagecapture.cpp
rename : g2log/src/g2LogMessageBuilder.hpp => g2log/src/g2logmessagecapture.hpp
2014-03-08 23:33:49 -07:00

29 lines
587 B
C++

#include <g2log.hpp>
#include "tester_sharedlib.h"
struct RuntimeLoadedLib : public SomeLibrary {
RuntimeLoadedLib() {
LOG(INFO) << "Library was created";
LOGF(INFO, "Ready for testing");
}
~RuntimeLoadedLib() {
LOG(DEBUG) << "Library destroyed";
}
void action() {
LOG(WARNING) << "Action, action, action. Safe for LOG calls by runtime dynamically loaded libraries";
}
};
struct RealLibraryFactory : public LibraryFactory {
SomeLibrary* CreateLibrary() {
return new RuntimeLoadedLib;
}
};
RealLibraryFactory testRealFactory;