--- /dev/null
+
+/*
+ * $Id: Debug.h,v 1.1 2003/01/17 05:14:29 robertc Exp $
+ *
+ * DEBUG: section 0 Debug Routines
+ * AUTHOR: Harvest Derived
+ *
+ * SQUID Web Proxy Cache http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ * Squid is the result of efforts by numerous individuals from
+ * the Internet community; see the CONTRIBUTORS file for full
+ * details. Many organizations have provided support for Squid's
+ * development; see the SPONSORS file for full details. Squid is
+ * Copyrighted (C) 2001 by the Regents of the University of
+ * California; see the COPYRIGHT file for full details. Squid
+ * incorporates software developed and/or copyrighted by other
+ * sources; see the CREDITS file for full details.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ */
+
+#ifndef SQUID_DEBUG
+#define SQUID_DEBUG
+
+class Debug
+{
+public:
+ static int Levels[MAX_DEBUG_SECTIONS];
+ static int level;
+};
+
+#endif /* SQUID_DEBUG */
/*
- * $Id: HttpHeaderTools.cc,v 1.33 2002/10/13 20:34:56 robertc Exp $
+ * $Id: HttpHeaderTools.cc,v 1.34 2003/01/17 05:14:29 robertc Exp $
*
* DEBUG: section 66 HTTP Header Tools
* AUTHOR: Alex Rousskov
else if (strstr(hstr, "\n\n"))
hstr_len -= 1;
httpHeaderInit(&hdr, hoReply);
- /* debugLevels[55] = 8; */
+ /* Debug::Levels[55] = 8; */
parse_success = httpHeaderParse(&hdr, hstr, hstr + hstr_len);
- /* debugLevels[55] = 2; */
+ /* Debug::Levels[55] = 2; */
if (!parse_success) {
debug(66, 2) ("TEST (%d): failed to parsed a header: {\n%s}\n", bug_count, hstr);
return;
#
# Makefile for the Squid Object Cache server
#
-# $Id: Makefile.am,v 1.45 2002/12/27 10:26:33 robertc Exp $
+# $Id: Makefile.am,v 1.46 2003/01/17 05:17:07 robertc Exp $
#
# Uncomment and customize the following to suit your needs:
#
comm_poll.cc \
comm_kqueue.cc \
debug.cc \
+ Debug.h \
defines.h \
$(DELAY_POOL_SOURCE) \
disk.cc \
/*
- * $Id: debug.cc,v 1.85 2002/09/01 15:16:35 hno Exp $
+ * $Id: debug.cc,v 1.86 2003/01/17 05:14:29 robertc Exp $
*
* DEBUG: section 0 Debug Routines
* AUTHOR: Harvest Derived
*/
#include "squid.h"
+#include "Debug.h"
+
+int Debug::Levels[MAX_DEBUG_SECTIONS];
+int Debug::level;
static char *debug_log_file = NULL;
static int Ctx_Lock = 0;
static void
_db_print_stderr(const char *format, va_list args)
{
- if (opt_debug_stderr < _db_level)
+ if (opt_debug_stderr < Debug::level)
return;
if (debug_log == stderr)
return;
{
LOCAL_ARRAY(char, tmpbuf, BUFSIZ);
/* level 0,1 go to syslog */
- if (_db_level > 1)
+ if (Debug::level > 1)
return;
if (0 == opt_syslog_enable)
return;
tmpbuf[0] = '\0';
vsnprintf(tmpbuf, BUFSIZ, format, args);
tmpbuf[BUFSIZ - 1] = '\0';
- syslog(_db_level == 0 ? LOG_WARNING : LOG_NOTICE, "%s", tmpbuf);
+ syslog(Debug::level == 0 ? LOG_WARNING : LOG_NOTICE, "%s", tmpbuf);
}
#endif /* HAVE_SYSLOG */
if (l > 10)
l = 10;
if (s >= 0) {
- debugLevels[s] = l;
+ Debug::Levels[s] = l;
return;
}
for (i = 0; i < MAX_DEBUG_SECTIONS; i++)
- debugLevels[i] = l;
+ Debug::Levels[i] = l;
}
static void
char *s = NULL;
for (i = 0; i < MAX_DEBUG_SECTIONS; i++)
- debugLevels[i] = -1;
+ Debug::Levels[i] = -1;
if (options) {
p = xstrdup(options);
/*
- * $Id: defines.h,v 1.110 2002/12/13 03:43:37 robertc Exp $
+ * $Id: defines.h,v 1.111 2003/01/17 05:14:29 robertc Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
#define COMM_NOCLOEXEC 0x02
#define COMM_REUSEADDR 0x04
+#include "Debug.h"
#define debug(SECTION, LEVEL) \
- ((_db_level = (LEVEL)) > debugLevels[SECTION]) ? (void) 0 : _db_print
+ ((Debug::level = (LEVEL)) > Debug::Levels[SECTION]) ? (void) 0 : _db_print
#define safe_free(x) if (x) { xxfree(x); x = NULL; }
/*
- * $Id: dns_internal.cc,v 1.50 2002/10/21 06:43:07 adrian Exp $
+ * $Id: dns_internal.cc,v 1.51 2003/01/17 05:14:29 robertc Exp $
*
* DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c
* AUTHOR: Duane Wessels
if (DnsSocket < 0)
fatal("Could not create a DNS socket");
/* Ouch... we can't call functions using debug from a debug
- * statement. Doing so messes up the internal _db_level
+ * statement. Doing so messes up the internal Debug::level
*/
port = comm_local_port(DnsSocket);
debug(78, 1) ("DNS Socket created at %s, port %d, FD %d\n",
/*
- * $Id: globals.h,v 1.115 2002/12/06 23:19:15 hno Exp $
+ * $Id: globals.h,v 1.116 2003/01/17 05:14:29 robertc Exp $
*
*
* SQUID Web Proxy Cache http://www.squid-cache.org/
extern int RESERVED_FD;
extern int Squid_MaxFD; /* SQUID_MAXFD */
extern int config_lineno; /* 0 */
-extern int debugLevels[MAX_DEBUG_SECTIONS];
extern int do_mallinfo; /* 0 */
extern int opt_reuseaddr; /* 1 */
extern int icmp_sock; /* -1 */
extern const String StringNull; /* { 0, 0, NULL } */
extern const MemBuf MemBufNull; /* MemBufNULL */
extern int hot_obj_count; /* 0 */
-extern int _db_level;
extern const int CacheDigestHashFuncCount; /* 4 */
extern CacheDigest *store_digest; /* NULL */
extern const char *StoreDigestFileName; /* "store_digest" */