From adf48508e1804223690e8d3ad12b416d7ead6fdc Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Mon, 21 Jun 2021 16:07:46 -0400 Subject: [PATCH] improve naming of plugin loggers --- common/include/villas/plugin.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/include/villas/plugin.hpp b/common/include/villas/plugin.hpp index 4014aaaa1..49f6f3199 100644 --- a/common/include/villas/plugin.hpp +++ b/common/include/villas/plugin.hpp @@ -131,6 +131,10 @@ public: virtual std::string getName() const = 0; + /// Get plugin type + virtual std::string + getType() const = 0; + // Get plugin description virtual std::string getDescription() const = 0; @@ -138,10 +142,12 @@ public: protected: std::string path; + virtual Logger getLogger() { - return logging.get("plugin:" + getName()); + auto name = fmt::format("{}:{}", getType(), getName()); + return logging.get(name); } };