diff --git a/common/include/villas/plugin.hpp b/common/include/villas/plugin.hpp index f62dce2f3..1ff5b2970 100644 --- a/common/include/villas/plugin.hpp +++ b/common/include/villas/plugin.hpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -139,6 +140,13 @@ public: virtual std::string getDescription() const = 0; + /** Custom formatter for spdlog */ + template + friend OStream &operator<<(OStream &os, const class Plugin &p) + { + return os << p.getName(); + } + protected: std::string path; @@ -160,7 +168,7 @@ Registry::dumpList() for (Plugin *p : *plugins) { T *t = dynamic_cast(p); if (t) - getLogger()->info(" - {}: {}", p->getName(), p->getDescription()); + getLogger()->info(" - {}: {}", *p, p->getDescription()); } }