summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-02-23 16:51:58 +0000
committerChristian Pointner <equinox@anytun.org>2009-02-23 16:51:58 +0000
commite421cba2ed5e6a7c3ed5661520892eef99aa1c20 (patch)
tree1e4018d5bc89f09a2ffe85a1e867866bfea6d6e6 /src
parentadded windows dependencies to readme (diff)
log targets get enabled at add only if prio > 0
Diffstat (limited to 'src')
-rw-r--r--src/log.cpp6
-rw-r--r--src/logTargets.cpp2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/log.cpp b/src/log.cpp
index 2517a94..d0ed7f8 100644
--- a/src/log.cpp
+++ b/src/log.cpp
@@ -69,7 +69,8 @@ void Log::addTarget(std::string conf)
Lock lock(mutex);
LogTarget* target = targets.add(conf);
target->open();
- target->enable();
+ if(target->getMaxPrio() > 0)
+ target->enable();
}
void Log::addTarget(LogTargetList::target_type_t type, int prio, std::string conf)
@@ -77,7 +78,8 @@ void Log::addTarget(LogTargetList::target_type_t type, int prio, std::string con
Lock lock(mutex);
LogTarget* target = targets.add(type, prio, conf);
target->open();
- target->enable();
+ if(target->getMaxPrio() > 0)
+ target->enable();
}
void Log::log(std::string msg, int prio)
diff --git a/src/logTargets.cpp b/src/logTargets.cpp
index 9bb4cfc..9a07309 100644
--- a/src/logTargets.cpp
+++ b/src/logTargets.cpp
@@ -270,7 +270,7 @@ void LogTargetSyslog::log(std::string msg, int prio)
if(!opened)
return;
- syslog(prio + 2 | facility, "%s", msg.c_str());
+ syslog((prio + 2) | facility, "%s", msg.c_str());
}
LogTargetSyslog& LogTargetSyslog::setLogName(std::string l)