]> git.stg.codes - stg.git/blobdiff - stglibs/logger.lib/include/stg/logger.h
Some minor improvements on ticket26.
[stg.git] / stglibs / logger.lib / include / stg / logger.h
index 115d1fb3907a71e63e2c798cf3f1d18d3cd60a08..e8d625a0f105b1f137c9a64514431e8f7b758c2f 100644 (file)
@@ -44,18 +44,19 @@ private:
     mutable pthread_mutex_t mutex;
 };
 //-----------------------------------------------------------------------------
-class PLUGIN_LOGGER : private STG_LOGGER
+class PLUGIN_LOGGER
 {
-friend PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER & logger, const std::string & pluginName);
+friend PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER& logger, const std::string& pluginName);
 
 public:
-    PLUGIN_LOGGER(const PLUGIN_LOGGER & rhs);
-    void operator()(const char * fmt, ...) const;
-    void operator()(const std::string & line) const;
+    PLUGIN_LOGGER(const PLUGIN_LOGGER& rhs) : m_parent(rhs.m_parent), m_pluginName(rhs.m_pluginName) {}
+    void operator()(const char* fmt, ...) const;
+    void operator()(const std::string& line) const;
 
 private:
     PLUGIN_LOGGER(const STG_LOGGER & logger, const std::string & pn);
-    std::string pluginName;
+    const STG_LOGGER& m_parent;
+    std::string m_pluginName;
 };
 
 PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER & logger, const std::string & pluginName);