--------------------- PatchSet 4563 Date: 2007/05/16 13:28:27 Author: adri Branch: squid3_logdaemon Tag: (none) Log: Handle checking for syslog if HAVE_SYSLOG is defined; create a LogFileSyslog instance if its detected. I've tested it, this works. Members: src/LogFileOpen.cc:1.1.2.2->1.1.2.3 Index: squid3/src/LogFileOpen.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Attic/LogFileOpen.cc,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid3/src/LogFileOpen.cc 16 May 2007 13:09:13 -0000 1.1.2.2 +++ squid3/src/LogFileOpen.cc 16 May 2007 13:28:27 -0000 1.1.2.3 @@ -5,6 +5,8 @@ * * Please include the names of authors of any patches made to this * file. + * + * $Id: LogFileOpen.cc,v 1.1.2.3 2007/05/16 13:28:27 adri Exp $ */ #include "squid.h" @@ -15,12 +17,23 @@ Core::LogFile * LogFileOpen(const char *path, int buf_sz, bool do_fatal) { - Core::LogFile *lf; - lf = new Core::LogFileBlocking(path, buf_sz, do_fatal); + Core::LogFile *lf = NULL; + +#if HAVE_SYSLOG + if (strcmp(path, "syslog") == 0 || strncmp(path, "syslog:", 7) == 0) { + lf = new Core::LogFileSyslog(path); + } +#endif + + /* Default - return LogFileBlocking */ + if (lf == NULL) + lf = new Core::LogFileBlocking(path, buf_sz, do_fatal); + + /* Only return the LogFile instance if the Open succeeds */ if (lf->Open()) return lf; - /* failed to open */ + /* failed to open; tidy up and leave */ delete lf; lf = NULL; return NULL;