]> git.stg.codes - stg.git/blobdiff - stglibs/logger.lib/logger.cpp
Explicit prohibition of the PLUGIN_LOGGER assignment.
[stg.git] / stglibs / logger.lib / logger.cpp
index 6289618e9b1895cf662c5c0381151e8bb0e2c1f5..20aa133aa9a1f06f6f928ff312f8e5e68a2cadcd 100644 (file)
@@ -1,9 +1,9 @@
+#include "stg/logger.h"
+
 #include <stdio.h>
 #include <stdarg.h>
 #include <syslog.h>
 
-#include "stg/logger.h"
-
 #ifdef STG_TIME
 extern const volatile time_t stgTime;
 #endif
@@ -97,18 +97,10 @@ else
     }
 }
 //-----------------------------------------------------------------------------
-PLUGIN_LOGGER::PLUGIN_LOGGER(const STG_LOGGER & logger, const std::string & pn)
-    : STG_LOGGER(),
-      pluginName(pn)
-{
-    SetLogFileName(logger.fileName);
-}
-//-----------------------------------------------------------------------------
-PLUGIN_LOGGER::PLUGIN_LOGGER(const PLUGIN_LOGGER & rhs)
-    : STG_LOGGER(),
-      pluginName(rhs.pluginName)
+PLUGIN_LOGGER::PLUGIN_LOGGER(const STG_LOGGER& logger, const std::string& pn)
+    : m_parent(logger),
+      m_pluginName(pn)
 {
-    SetLogFileName(fileName);
 }
 //-----------------------------------------------------------------------------
 void PLUGIN_LOGGER::operator()(const char * fmt, ...) const
@@ -120,12 +112,12 @@ va_start(vl, fmt);
 vsnprintf(buff, sizeof(buff), fmt, vl);
 va_end(vl);
 
-STG_LOGGER::operator()("[%s] %s", pluginName.c_str(), buff);
+m_parent("[%s] %s", m_pluginName.c_str(), buff);
 }
 //-----------------------------------------------------------------------------
 void PLUGIN_LOGGER::operator()(const std::string & line) const
 {
-STG_LOGGER::operator()("[%s] %s", pluginName.c_str(), line.c_str());
+m_parent("[%s] %s", m_pluginName.c_str(), line.c_str());
 }
 //-----------------------------------------------------------------------------
 PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER & logger, const std::string & pluginName)