]> git.stg.codes - stg.git/commitdiff
Explicit prohibition of the PLUGIN_LOGGER assignment.
authorMaxim Mamontov <faust.madf@gmail.com>
Sun, 18 Feb 2018 14:57:57 +0000 (16:57 +0200)
committerMaxim Mamontov <faust.madf@gmail.com>
Sun, 18 Feb 2018 14:57:57 +0000 (16:57 +0200)
stglibs/logger.lib/include/stg/logger.h
stglibs/logger.lib/logger.cpp

index 5165f0fb7203b540fa69bac94f18564e1768aa8c..60514f4a9d311de3d7f6f971df5cff24b31921da 100644 (file)
@@ -49,11 +49,13 @@ class PLUGIN_LOGGER
 friend PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER& logger, const std::string& pluginName);
 
 public:
 friend PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER& logger, const std::string& pluginName);
 
 public:
-    PLUGIN_LOGGER(const PLUGIN_LOGGER& rhs) : m_parent(rhs.m_parent), m_pluginName(rhs.m_pluginName) {}
+    PLUGIN_LOGGER(const PLUGIN_LOGGER& rhs) : m_parent(rhs.m_parent), m_pluginName(rhs.m_pluginName) {} // Need move here.
     void operator()(const char* fmt, ...) const;
     void operator()(const std::string& line) const;
 
 private:
     void operator()(const char* fmt, ...) const;
     void operator()(const std::string& line) const;
 
 private:
+    PLUGIN_LOGGER& operator=(const PLUGIN_LOGGER&); // Copy assignment is prohibited.
+
     PLUGIN_LOGGER(const STG_LOGGER & logger, const std::string & pn);
     const STG_LOGGER& m_parent;
     std::string m_pluginName;
     PLUGIN_LOGGER(const STG_LOGGER & logger, const std::string & pn);
     const STG_LOGGER& m_parent;
     std::string m_pluginName;
index 4a4552576da1df7b1536eb55baeef62acb0898af..20aa133aa9a1f06f6f928ff312f8e5e68a2cadcd 100644 (file)
@@ -1,9 +1,9 @@
+#include "stg/logger.h"
+
 #include <stdio.h>
 #include <stdarg.h>
 #include <syslog.h>
 
 #include <stdio.h>
 #include <stdarg.h>
 #include <syslog.h>
 
-#include "stg/logger.h"
-
 #ifdef STG_TIME
 extern const volatile time_t stgTime;
 #endif
 #ifdef STG_TIME
 extern const volatile time_t stgTime;
 #endif