summaryrefslogtreecommitdiff
path: root/src/log.cpp
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2008-11-28 18:45:57 +0000
committerOthmar Gsenger <otti@anytun.org>2008-11-28 18:45:57 +0000
commitac2147483cfcbb6f01123d65e67b7bb363bddc8f (patch)
treed7812a08b15dbc54df6f97b7b64ae913972f309b /src/log.cpp
parentsome more type cleanups and missig NOCRYPT defines (diff)
added some windows support (not working now)
try to build with following Options: NOCRYPT;NODAEMON;NOEXEC;NOPACKED;NOSYSLOG;NOROUTING;NOSIGNALCONTROLLER
Diffstat (limited to 'src/log.cpp')
-rw-r--r--src/log.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/log.cpp b/src/log.cpp
index 23922cc..72c3d3c 100644
--- a/src/log.cpp
+++ b/src/log.cpp
@@ -31,7 +31,6 @@
#include <iostream>
#include <string>
-#include <syslog.h>
#include "log.h"
@@ -54,7 +53,9 @@ LogStringBuilder::LogStringBuilder(Log& l, int p) : log(l), prio(p)
LogStringBuilder::~LogStringBuilder()
{
Lock lock(log.mutex);
+#ifndef NOSYSLOG
syslog(prio | log.getFacility(), stream.str().c_str());
+#endif
}
Log& Log::instance()
@@ -69,19 +70,23 @@ Log& Log::instance()
Log::Log()
{
- facility = LOG_DAEMON;
+ facility = FAC_DAEMON;
logName = "anytun";
open();
}
Log::~Log()
{
+#ifndef NOSYSLOG
closelog();
+#endif
}
void Log::open()
{
+#ifndef NOSYSLOG
openlog(logName.c_str(), LOG_PID, facility);
+#endif
}
Log& Log::setLogName(std::string newLogName)