]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added "HERE" macro for use in debugs() and use it in a few ICAP
authorwessels <>
Tue, 20 Dec 2005 05:00:47 +0000 (05:00 +0000)
committerwessels <>
Tue, 20 Dec 2005 05:00:47 +0000 (05:00 +0000)
debugging messages.

src/Debug.h
src/ICAP/ICAPModXact.cc
src/ICAP/ICAPXaction.cc

index 6b9d90c6a82f6705565e1ab6a8ff0554787a91fe..9ef1448805036245b2544c4cc92195e5ab179e15 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: Debug.h,v 1.7 2003/08/31 21:20:08 robertc Exp $
+ * $Id: Debug.h,v 1.8 2005/12/19 22:00:47 wessels Exp $
  *
  * DEBUG: section 0     Debug Routines
  * AUTHOR: Harvest Derived
@@ -75,4 +75,11 @@ private:
         } \
    } while (/*CONSTCOND*/ 0)
 
+/*
+ * HERE is a macro that you can use like this:
+ *
+ * debugs(1,1, HERE << "some message");
+ */
+#define HERE __FILE__<<"("<<__LINE__<<") "
+
 #endif /* SQUID_DEBUG */
index da763b9a76232ec34dcd6834d73d732b7362b3b6..26650e5e38ea8c16227a2edbd0e5116beb8e88c7 100644 (file)
@@ -694,7 +694,7 @@ void ICAPModXact::parseHttpHead()
 bool ICAPModXact::parseHead(HttpMsg *head)
 {
     assert(head);
-    debugs(93, 5, "have " << readBuf.contentSize() << " head bytes to parse" <<
+    debugs(93, 5, HERE << "have " << readBuf.contentSize() << " head bytes to parse" <<
            "; state: " << state.parsing);
 
     http_status error = HTTP_STATUS_NONE;
index 2a6503ca9c1e622d531656334502a169535f15c5..826aa25b03e79e920e9b9d0650c2bda4d37f3c93 100644 (file)
@@ -88,7 +88,7 @@ void ICAPXaction::openConnection()
     connection = icapPconnPool->pop(s.host.buf(), s.port, NULL);
 
     if (connection >= 0) {
-        debug(93,3)("%s(%d) reused pconn FD %d\n", __FILE__, __LINE__, connection);
+        debugs(93,3, HERE << "reused pconn FD " << connection);
         eventAdd("ICAPXaction::reusedConnection",
                  reusedConnection,
                  this,
@@ -147,10 +147,10 @@ void ICAPXaction::closeConnection()
         cancelRead();
 
         if (reuseConnection) {
-            debug(93,3)("%s(%d) pushing pconn %d\n", __FILE__,__LINE__,connection);
+            debugs(93,3, HERE << "pushing pconn " << connection);
             icapPconnPool->push(connection, theService->host.buf(), theService->port, NULL);
         } else {
-            debug(93,3)("%s(%d) closing pconn %d\n", __FILE__,__LINE__,connection);
+            debugs(93,3, HERE << "closing pconn " << connection);
             comm_close(connection);
         }
 
@@ -265,7 +265,7 @@ void ICAPXaction::noteCommRead(comm_err_t commStatus, size_t sz)
     Must(commStatus == COMM_OK);
     Must(sz >= 0);
 
-    debugs(93, 5, "read " << sz << " bytes");
+    debugs(93, 5, HERE << "read " << sz << " bytes");
 
     /*
      * See comments in ICAPXaction.h about why we use commBuf
@@ -300,7 +300,7 @@ void ICAPXaction::cancelRead()
 
 bool ICAPXaction::parseHttpMsg(HttpMsg *msg)
 {
-    debugs(93, 5, "have " << readBuf.contentSize() << " head bytes to parse");
+    debugs(93, 5, HERE << "have " << readBuf.contentSize() << " head bytes to parse");
 
     http_status error = HTTP_STATUS_NONE;
     const bool parsed = msg->parse(&readBuf, commEof, &error);