2014-07-03 23:42:19 +02:00
|
|
|
/** ==========================================================================
|
|
|
|
* 2014 by KjellKod.cc. This is PUBLIC DOMAIN to use at your own risk and comes
|
|
|
|
* with no warranties. This code is yours to share, use and modify with no
|
|
|
|
* strings attached and no restrictions or obligations.
|
|
|
|
*
|
|
|
|
* For more information see g3log/LICENSE or refer refer to http://unlicense.org
|
|
|
|
* ============================================================================*/
|
|
|
|
|
2014-03-09 07:33:49 +01:00
|
|
|
|
2015-07-20 07:10:56 +02:00
|
|
|
#include <g3log/g3log.hpp>
|
|
|
|
#include <g3log/logworker.hpp>
|
2014-03-09 07:33:49 +01:00
|
|
|
#include "tester_sharedlib.h"
|
|
|
|
|
|
|
|
struct RuntimeLoadedLib : public SomeLibrary {
|
|
|
|
|
|
|
|
RuntimeLoadedLib() {
|
|
|
|
LOG(INFO) << "Library was created";
|
|
|
|
LOGF(INFO, "Ready for testing");
|
|
|
|
}
|
|
|
|
|
|
|
|
~RuntimeLoadedLib() {
|
2017-05-17 22:24:11 +02:00
|
|
|
LOG(G3LOG_DEBUG) << "Library destroyed";
|
2014-03-09 07:33:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
|