From 28e01b8c6a137a9e98d95689be3d3d72be18d9d7 Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Sun, 14 Jul 2002 19:08:08 +0000 Subject: - Non-KDE stuff now builds correctly with gcc3 --- lib/log.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/log.cc') diff --git a/lib/log.cc b/lib/log.cc index 48b07d8..321de6a 100644 --- a/lib/log.cc +++ b/lib/log.cc @@ -22,18 +22,24 @@ * */ #include "log.h" +#include -logbuf::logbuf(int _level) { +logbuf::logbuf(int level, int fd) { ptr = buf; len = 0; - level = _level; + _on = true; + _level = level; + _fd = fd; } int logbuf::overflow(int c) { if (c == '\n') { *ptr++ = '\n'; *ptr = '\0'; - syslog(level, buf); + if (_on) + syslog(_level, buf); + else if (_fd != -1) + write(_fd, buf, len + 1); ptr = buf; len = 0; return 0; -- cgit v1.2.3