mirror of
https://github.com/KjellKod/g3log.git
synced 2025-01-09 19:17:39 +01:00
f5438d8232
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
29 lines
587 B
C++
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;
|
|
|