/*
- * $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
} \
} 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 */
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;
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,
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);
}
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
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);