8 const char * LogDate(time_t t);
9 //-----------------------------------------------------------------------------
11 STG_LOGGER & GetStgLogger();
12 //-----------------------------------------------------------------------------
13 class STG_LOGGER_LOCKER
16 STG_LOGGER_LOCKER(pthread_mutex_t * m) : mutex(m) { pthread_mutex_lock(mutex); };
17 ~STG_LOGGER_LOCKER() { pthread_mutex_unlock(mutex); };
20 STG_LOGGER_LOCKER(const STG_LOGGER_LOCKER & rvalue);
21 STG_LOGGER_LOCKER & operator=(const STG_LOGGER_LOCKER & rvalue);
23 pthread_mutex_t * mutex;
25 //-----------------------------------------------------------------------------
28 friend STG_LOGGER & GetStgLogger();
29 friend class PLUGIN_LOGGER;
33 void SetLogFileName(const std::string & fn);
34 void operator()(const char * fmt, ...) const;
38 STG_LOGGER(const STG_LOGGER & rvalue);
39 STG_LOGGER & operator=(const STG_LOGGER & rvalue);
41 const char * LogDate(time_t t) const;
44 mutable pthread_mutex_t mutex;
46 //-----------------------------------------------------------------------------
47 class PLUGIN_LOGGER : private STG_LOGGER
49 friend PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER & logger, const std::string & pluginName);
52 PLUGIN_LOGGER(const PLUGIN_LOGGER & rhs);
53 void operator()(const char * fmt, ...) const;
56 PLUGIN_LOGGER(const STG_LOGGER & logger, const std::string & pn);
57 std::string pluginName;
60 PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER & logger, const std::string & pluginName);