git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allowed to build on Darwin.
[stg.git]
/
stglibs
/
logger.lib
/
include
/
stg
/
logger.h
diff --git
a/stglibs/logger.lib/include/stg/logger.h
b/stglibs/logger.lib/include/stg/logger.h
index dc87178e4a487dedc58d8cedce793106edf450aa..115d1fb3907a71e63e2c798cf3f1d18d3cd60a08 100644
(file)
--- a/
stglibs/logger.lib/include/stg/logger.h
+++ b/
stglibs/logger.lib/include/stg/logger.h
@@
-11,8
+11,8
@@
STG_LOGGER & GetStgLogger();
class STG_LOGGER_LOCKER
{
public:
class STG_LOGGER_LOCKER
{
public:
- STG_LOGGER_LOCKER(pthread_mutex_t * m) : mutex(m) { pthread_mutex_lock(mutex); }
;
- ~STG_LOGGER_LOCKER() { pthread_mutex_unlock(mutex); }
;
+ STG_LOGGER_LOCKER(pthread_mutex_t * m) : mutex(m) { pthread_mutex_lock(mutex); }
+ ~STG_LOGGER_LOCKER() { pthread_mutex_unlock(mutex); }
private:
STG_LOGGER_LOCKER(const STG_LOGGER_LOCKER & rvalue);
private:
STG_LOGGER_LOCKER(const STG_LOGGER_LOCKER & rvalue);
@@
-30,6
+30,7
@@
public:
~STG_LOGGER();
void SetLogFileName(const std::string & fn);
void operator()(const char * fmt, ...) const;
~STG_LOGGER();
void SetLogFileName(const std::string & fn);
void operator()(const char * fmt, ...) const;
+ void operator()(const std::string & line) const { LogString(line.c_str()); }
private:
STG_LOGGER();
private:
STG_LOGGER();
@@
-37,6
+38,7
@@
private:
STG_LOGGER & operator=(const STG_LOGGER & rvalue);
const char * LogDate(time_t t) const;
STG_LOGGER & operator=(const STG_LOGGER & rvalue);
const char * LogDate(time_t t) const;
+ void LogString(const char * str) const;
std::string fileName;
mutable pthread_mutex_t mutex;
std::string fileName;
mutable pthread_mutex_t mutex;
@@
-49,6
+51,7
@@
friend PLUGIN_LOGGER GetPluginLogger(const STG_LOGGER & logger, const std::strin
public:
PLUGIN_LOGGER(const PLUGIN_LOGGER & rhs);
void operator()(const char * fmt, ...) const;
public:
PLUGIN_LOGGER(const PLUGIN_LOGGER & rhs);
void operator()(const char * fmt, ...) const;
+ void operator()(const std::string & line) const;
private:
PLUGIN_LOGGER(const STG_LOGGER & logger, const std::string & pn);
private:
PLUGIN_LOGGER(const STG_LOGGER & logger, const std::string & pn);