/* Not private, to allow class hierarchies */
void RefCountReference() const {
#if REFCOUNT_DEBUG
- debug (0,1)("Incrementing this %p from count %u\n",this,count_);
+ old_debug(0,1)("Incrementing this %p from count %u\n",this,count_);
#endif
++count_;
unsigned RefCountDereference() const {
#if REFCOUNT_DEBUG
- debug (0,1)("Decrementing this %p from count %u\n",this,count_);
+ old_debug(0,1)("Decrementing this %p from count %u\n",this,count_);
#endif
return --count_;
const size_t BuildPrefixInit();
const char * SkipBuildPrefix(const char* path);
-
/* Debug stream */
#define debugs(SECTION, LEVEL, CONTENT) \
do { \
return (os << (int)d);
}
+/* Legacy debug style. Still used in some places. needs to die... */
+#define do_debug(SECTION, LEVEL) ((Debug::level = (LEVEL)) > Debug::Levels[SECTION])
+#define old_debug(SECTION, LEVEL) \
+ do_debug(SECTION, LEVEL) ? (void) 0 : _db_print
+
+
#endif /* SQUID_DEBUG_H */
{
assert(sline && p);
debugs(57, 9, "packing sline " << sline << " using " << p << ":");
- debug(57, 9) (HttpStatusLineFormat, sline->version.major,
- sline->version.minor, sline->status,
- sline->reason ? sline->reason : httpStatusString(sline->status));
+ debugs(57, 9, "FORMAT=" << HttpStatusLineFormat );
+ debugs(57, 9, "HTTP/" << sline->version.major << "." << sline->version.minor <<
+ " " << sline->status << " " << (sline->reason ? sline->reason : httpStatusString(sline->status)) );
packerPrintf(p, HttpStatusLineFormat, sline->version.major,
sline->version.minor, sline->status, httpStatusLineReason(sline));
}
void mayUseConnection(bool aBool) {
mayUseConnection_ = aBool;
- debug (33,3)("ClientSocketContext::mayUseConnection: This %p marked %d\n",
- this, aBool);
+ debugs(33,3, HERE << "This " << this << " marked " << aBool);
}
class DeferredParams
#define COMM_REUSEADDR 0x04
#define COMM_TRANSPARENT 0x08
-#include "Debug.h"
-#define do_debug(SECTION, LEVEL) ((Debug::level = (LEVEL)) > Debug::Levels[SECTION])
-#define debug(SECTION, LEVEL) \
- do_debug(SECTION, LEVEL) ? (void) 0 : _db_print
-
#define safe_free(x) if (x) { xxfree(x); x = NULL; }
#define DISK_OK (0)
switch (s.valuestored) {
case ESI_LITERAL_INVALID:
- debug(86, 1) ( " Invalid " );
+ old_debug(86, 1) ( " Invalid " );
break;
case ESI_LITERAL_FLOAT:
- debug (86,1) ("%f", s.value.floating);
+ old_debug(86,1) ("%f", s.value.floating);
break;
case ESI_LITERAL_STRING:
- debug (86,1) ("'%s'", s.value.string);
+ old_debug(86,1) ("'%s'", s.value.string);
break;
case ESI_LITERAL_INT:
- debug (86,1) ("%d", s.value.integral);
+ old_debug(86,1) ("%d", s.value.integral);
break;
case ESI_LITERAL_BOOL:
- debug (86,1)("%s",s.value.integral ? "true" : "false");
+ old_debug(86,1)("%s",s.value.integral ? "true" : "false");
}
}
switch (s.valuetype) {
case ESI_EXPR_INVALID:
- debug (86,1) (" Invalid ");
+ old_debug(86,1) (" Invalid ");
break;
case ESI_EXPR_LITERAL:
break;
case ESI_EXPR_EXPR:
- debug (86,1) ("%s", s.value.integral ? "true" : "false");
+ old_debug(86,1) ("%s", s.value.integral ? "true" : "false");
break;
case ESI_EXPR_OR:
- debug (86,1) ("|");
+ old_debug(86,1) ("|");
break;
case ESI_EXPR_AND:
- debug (86,1) ("&");
+ old_debug(86,1) ("&");
break;
case ESI_EXPR_NOT:
- debug (86,1) ("!");
+ old_debug(86,1) ("!");
break;
case ESI_EXPR_START:
- debug (86,1) ("(");
+ old_debug(86,1) ("(");
break;
case ESI_EXPR_END:
- debug (86,1) (")");
+ old_debug(86,1) (")");
break;
case ESI_EXPR_EQ:
- debug (86,1) ("==");
+ old_debug(86,1) ("==");
break;
case ESI_EXPR_NOTEQ:
- debug (86,1) ("!=");
+ old_debug(86,1) ("!=");
break;
case ESI_EXPR_LESS:
- debug (86,1) ("<");
+ old_debug(86,1) ("<");
break;
case ESI_EXPR_LESSEQ:
- debug (86,1) ("<=");
+ old_debug(86,1) ("<=");
break;
case ESI_EXPR_MORE:
- debug (86,1) (">");
+ old_debug(86,1) (">");
break;
case ESI_EXPR_MOREEQ:
- debug (86,1) (">=");
+ old_debug(86,1) (">=");
break;
}
}
printmember (stack[i]);
if (depth)
- debug (86,1) ("\n");
+ old_debug(86,1) ("\n");
}
int
extern void clientAccessCheck(void *);
+#include "Debug.h"
/* see debug.c for info on context-based debugging */
SQUIDCEXTERN Ctx ctx_enter(const char *descr);
SQUIDCEXTERN void ctx_exit(Ctx ctx);
SQUIDCEXTERN void _db_print(const char *,...) PRINTF_FORMAT_ARG1;
-/* packs, then prints an object using debug() */
+/* packs, then prints an object using debugs() */
SQUIDCEXTERN void debugObj(int section, int level, const char *label, void *obj, ObjPackMethod pm);
/* disk.c */
static void
snmpSnmplibDebug(int lvl, char *buf)
{
- debug(49, lvl) ("%s", buf);
+ debugs(49, lvl, buf);
}
sigusr2_handle(int sig)
{
static int state = 0;
- /* no debug() here; bad things happen if the signal is delivered during _db_print() */
+ /* no debugs() here; bad things happen if the signal is delivered during _db_print() */
if (state == 0) {
#ifndef MEM_GEN_TRACE
pid = waitpid(-1, &status, WNOHANG);
#endif
- /* no debug() here; bad things happen if the signal is delivered during _db_print() */
+ /* no debugs() here; bad things happen if the signal is delivered during _db_print() */
#if HAVE_SIGACTION
} while (pid > 0);
void
fatal_dump(const char *message)
{
- debug (0,0) ("Fatal: %s",message);
+ fprintf(stderr, "Fatal: %s",message);
exit (1);
}
void
fatal(const char *message)
{
- debug (0,0) ("Fatal: %s",message);
+ fprintf(stderr, "Fatal: %s", message);
exit (1);
}
abort();
}
-std::ostringstream *Debug::CurrentDebug (NULL);
+std::ostringstream *Debug::CurrentDebug(NULL);
MemAllocator *dlink_node_pool = NULL;