summaryrefslogtreecommitdiff
path: root/src/log.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-02-20 06:49:27 +0000
committerChristian Pointner <equinox@anytun.org>2009-02-20 06:49:27 +0000
commit9e2398cd2195370f428bcdcd8cbd852d2fccc56a (patch)
treec503bec6b18afc9ee9b572938be763451aa7a922 /src/log.h
parentcode cleanup (diff)
moved NO_SYSLOG to inverse LOG_SYSLOG switch
added LOG_WINEVENTLOG (experimental)
Diffstat (limited to 'src/log.h')
-rw-r--r--src/log.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/log.h b/src/log.h
index de6da92..6975ed5 100644
--- a/src/log.h
+++ b/src/log.h
@@ -34,14 +34,13 @@
#include <string>
#include <sstream>
-#ifndef NO_SYSLOG
+#ifdef LOG_SYSLOG
#include <syslog.h>
#endif
#include "threadUtils.hpp"
-
-#define STERROR_TEXT_MAX 100
+#define STERROR_TEXT_MAX 200
#ifndef NO_CRYPT
#ifndef USE_SSL_CRYPTO
@@ -86,7 +85,7 @@ private:
class Log : public std::ostringstream
{
public:
-#ifndef NO_SYSLOG
+#ifdef LOG_SYSLOG
static const int FAC_USER = LOG_USER;
static const int FAC_MAIL = LOG_MAIL;
static const int FAC_DAEMON = LOG_DAEMON;
@@ -144,9 +143,14 @@ public:
static const int PRIO_NOTICE = 6;
static const int PRIO_INFO = 7;
static const int PRIO_DEBUG = 8;
-
+#endif
+#ifdef LOG_STDOUT
static std::string prioToString(int prio);
#endif
+#ifdef LOG_WINEVENTLOG
+ static WORD prioToEventLogType(int prio);
+#endif
+
static Log& instance();
@@ -180,6 +184,9 @@ private:
std::string logName;
int facility;
+#ifdef LOG_WINEVENTLOG
+ HANDLE h_event_source_;
+#endif
};
extern Log& cLog;