trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iga...@apache.org
Subject [3/5] TS-2106: transform all plugins to new logging non-API
Date Sun, 11 Aug 2013 18:31:21 GMT
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/experimental/rfc5861/rfc5861.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/rfc5861/rfc5861.c b/plugins/experimental/rfc5861/rfc5861.c
index 384aa91..3646faa 100644
--- a/plugins/experimental/rfc5861/rfc5861.c
+++ b/plugins/experimental/rfc5861/rfc5861.c
@@ -36,7 +36,8 @@
 #include "ts/ts.h"
 #include "ts/experimental.h"
 
-#define LOG_PREFIX "rfc5861"
+#define PLUGIN_NAME "rfc5861"
+#include <ts/debug.h>
 
 //#define ENABLE_SAVE_ORIGINAL_REQUEST
 
@@ -96,7 +97,7 @@ create_response_info(void)
 {
     ResponseInfo *resp_info;
 
-    TSDebug(LOG_PREFIX, "Entering create_response_info");
+    TSLogDebug("Entering create_response_info");
 
     resp_info = (ResponseInfo *) TSmalloc(sizeof(ResponseInfo));
 
@@ -105,7 +106,7 @@ create_response_info(void)
     resp_info->parser = TSHttpParserCreate();
     resp_info->parsed = false;
 
-    TSDebug(LOG_PREFIX, "Leaving create_reseponse_info");
+    TSLogDebug("Leaving create_reseponse_info");
 
     return resp_info;
 }
@@ -113,14 +114,14 @@ create_response_info(void)
 static void
 free_response_info(ResponseInfo *resp_info)
 {
-    TSDebug(LOG_PREFIX, "Entering free_response_info");
+    TSLogDebug("Entering free_response_info");
 
     TSHandleMLocRelease(resp_info->buf, TS_NULL_MLOC, resp_info->http_hdr_loc);
     TSMBufferDestroy(resp_info->buf);
     TSHttpParserDestroy(resp_info->parser);
     TSfree(resp_info);
 
-    TSDebug(LOG_PREFIX, "Leaving free_response_info");
+    TSLogDebug("Leaving free_response_info");
 }
 
 static RequestInfo*
@@ -132,14 +133,14 @@ create_request_info(TSHttpTxn txn)
     TSMBuffer buf;
     TSMLoc loc;
 
-    TSDebug(LOG_PREFIX, "Entering create_request_info");
+    TSLogDebug("Entering create_request_info");
 
     req_info = (RequestInfo *) TSmalloc(sizeof(RequestInfo));
 
     url = TSHttpTxnEffectiveUrlStringGet(txn, &url_len);
     req_info->effective_url = TSstrndup(url, url_len);
     TSfree(url);
-    //TSDebug(LOG_PREFIX, "URL: %s", req_info->effective_url);
+    //TSLogDebug("URL: %s", req_info->effective_url);
 
     TSHttpTxnClientReqGet(txn, &buf, &loc);
     req_info->buf = TSMBufferCreate();
@@ -149,7 +150,7 @@ create_request_info(TSHttpTxn txn)
     req_info->client_addr = TSmalloc(sizeof(struct sockaddr));
     memmove((void *) req_info->client_addr, (void *) TSHttpTxnClientAddrGet(txn), sizeof(struct sockaddr));
 
-    TSDebug(LOG_PREFIX, "Leaving create_request_info");
+    TSLogDebug("Leaving create_request_info");
 
     return req_info;
 }
@@ -157,20 +158,20 @@ create_request_info(TSHttpTxn txn)
 static void
 free_request_info(RequestInfo *req_info)
 {
-    TSDebug(LOG_PREFIX, "Entering free_request_info");
-    TSDebug(LOG_PREFIX, "Free effective URL");
-    //TSDebug(LOG_PREFIX, "URL: %s", req_info->effective_url);
+    TSLogDebug("Entering free_request_info");
+    TSLogDebug("Free effective URL");
+    //TSLogDebug("URL: %s", req_info->effective_url);
     TSfree(req_info->effective_url);
-    TSDebug(LOG_PREFIX, "Release Http Header");
+    TSLogDebug("Release Http Header");
     TSHandleMLocRelease(req_info->buf, TS_NULL_MLOC, req_info->http_hdr_loc);
-    TSDebug(LOG_PREFIX, "Destroy Buffer");
+    TSLogDebug("Destroy Buffer");
     TSMBufferDestroy(req_info->buf);
-    TSDebug(LOG_PREFIX, "Free Client Addr");
+    TSLogDebug("Free Client Addr");
     TSfree(req_info->client_addr);
-    TSDebug(LOG_PREFIX, "Free Request Info");
+    TSLogDebug("Free Request Info");
     TSfree(req_info);
 
-    TSDebug(LOG_PREFIX, "Leaving free_request_info");
+    TSLogDebug("Leaving free_request_info");
 }
 
 static CachedHeaderInfo*
@@ -188,14 +189,14 @@ get_cached_header_info(TSHttpTxn txn)
     chi->stale_while_revalidate = 0;
     chi->stale_on_error = 0;
 
-    TSDebug(LOG_PREFIX, "Inside get_cached_header_info");
+    TSLogDebug("Inside get_cached_header_info");
 
     if (TSHttpTxnCachedRespGet(txn, &cr_buf, &cr_hdr_loc) == TS_SUCCESS)
     {
         cr_date_loc = TSMimeHdrFieldFind(cr_buf, cr_hdr_loc, TS_MIME_FIELD_DATE, TS_MIME_LEN_DATE);
         if (cr_date_loc != TS_NULL_MLOC)
         {
-            TSDebug(LOG_PREFIX, "Found a date");
+            TSLogDebug("Found a date");
             chi->date = TSMimeHdrFieldValueDateGet(cr_buf, cr_hdr_loc, cr_date_loc);
             TSHandleMLocRelease(cr_buf, cr_hdr_loc, cr_date_loc);
         }
@@ -204,7 +205,7 @@ get_cached_header_info(TSHttpTxn txn)
 
         while(cr_cache_control_loc != TS_NULL_MLOC)
         {
-            TSDebug(LOG_PREFIX, "Found cache-control");
+            TSLogDebug("Found cache-control");
             cr_cache_control_count = TSMimeHdrFieldValuesCount(cr_buf, cr_hdr_loc, cr_cache_control_loc);
 
             for (i = 0; i < cr_cache_control_count; i++)
@@ -214,7 +215,7 @@ get_cached_header_info(TSHttpTxn txn)
 
                 if (strncmp(value, TS_HTTP_VALUE_MAX_AGE, TS_HTTP_LEN_MAX_AGE) == 0)
                 {
-                    TSDebug(LOG_PREFIX, "Found max-age");
+                    TSLogDebug("Found max-age");
                     ptr += TS_HTTP_LEN_MAX_AGE;
                     if (*ptr == '=')
                     {
@@ -224,13 +225,13 @@ get_cached_header_info(TSHttpTxn txn)
                     else
                     {
                         ptr = TSstrndup(value, TS_HTTP_LEN_MAX_AGE + 2);
-                        TSDebug(LOG_PREFIX, "This is what I found: %s", ptr);
+                        TSLogDebug("This is what I found: %s", ptr);
                         TSfree(ptr);
                     }
                 }
                 else if (strncmp(value, HTTP_VALUE_STALE_WHILE_REVALIDATE, strlen(HTTP_VALUE_STALE_WHILE_REVALIDATE)) == 0)
                 {
-                    TSDebug(LOG_PREFIX, "Found stale-while-revalidate");
+                    TSLogDebug("Found stale-while-revalidate");
                     ptr += strlen(HTTP_VALUE_STALE_WHILE_REVALIDATE);
                     if (*ptr == '=')
                     {
@@ -240,7 +241,7 @@ get_cached_header_info(TSHttpTxn txn)
                 }
                 else if (strncmp(value, HTTP_VALUE_STALE_IF_ERROR, strlen(HTTP_VALUE_STALE_IF_ERROR)) == 0)
                 {
-                    TSDebug(LOG_PREFIX, "Found stale-on-error");
+                    TSLogDebug("Found stale-on-error");
                     ptr += strlen(HTTP_VALUE_STALE_IF_ERROR);
                     if (*ptr == '=')
                     {
@@ -250,7 +251,7 @@ get_cached_header_info(TSHttpTxn txn)
                 }
                 else
                 {
-                    TSDebug(LOG_PREFIX, "Unknown field value");
+                    TSLogDebug("Unknown field value");
                 }
             }
 
@@ -261,7 +262,7 @@ get_cached_header_info(TSHttpTxn txn)
         TSHandleMLocRelease(cr_buf, TS_NULL_MLOC, cr_hdr_loc);
     }
 
-    TSDebug(LOG_PREFIX, "Leaving get_cached_header_info");
+    TSLogDebug("Leaving get_cached_header_info");
     return chi;
 }
 
@@ -279,7 +280,7 @@ parse_response(StateInfo *state)
     int64_t avail;
     char *start;
 
-    TSDebug(LOG_PREFIX, "Entering parse_response");
+    TSLogDebug("Entering parse_response");
 
     block = TSIOBufferReaderStart(state->resp_io_buf_reader);
 
@@ -297,10 +298,10 @@ parse_response(StateInfo *state)
     {
         state->resp_info->status = TSHttpHdrStatusGet(state->resp_info->buf, state->resp_info->http_hdr_loc);
         state->resp_info->parsed = true;
-        TSDebug(LOG_PREFIX, "HTTP Status: %d", state->resp_info->status);
+        TSLogDebug("HTTP Status: %d", state->resp_info->status);
     }
 
-    TSDebug(LOG_PREFIX, "Leaving parse_response");
+    TSLogDebug("Leaving parse_response");
 }
 
 static int
@@ -312,7 +313,7 @@ consume_resource(TSCont cont, TSEvent event ATS_UNUSED, void *edata ATS_UNUSED)
     TSMLoc url_loc;
     int lookup_count;
 
-    TSDebug(LOG_PREFIX, "Entering consume_resource");
+    TSLogDebug("Entering consume_resource");
 
     vconn = (TSVConn) edata;
     state = (StateInfo *) TSContDataGet(cont);
@@ -321,15 +322,15 @@ consume_resource(TSCont cont, TSEvent event ATS_UNUSED, void *edata ATS_UNUSED)
     {
         case TS_EVENT_VCONN_WRITE_READY:
             // We shouldn't get here because we specify the exact size of the buffer.
-            TSDebug(LOG_PREFIX, "Write Ready");
+            TSLogDebug("Write Ready");
         case TS_EVENT_VCONN_WRITE_COMPLETE:
-            TSDebug(LOG_PREFIX, "Write Complete");
-            //TSDebug(LOG_PREFIX, "TSVConnShutdown()");
+            TSLogDebug("Write Complete");
+            //TSLogDebug("TSVConnShutdown()");
             //TSVConnShutdown(state->vconn, 0, 1);
             //TSVIOReenable(state->w_vio);
             break;
         case TS_EVENT_VCONN_READ_READY:
-            TSDebug(LOG_PREFIX, "Read Ready");
+            TSLogDebug("Read Ready");
 
             avail = TSIOBufferReaderAvail(state->resp_io_buf_reader);
 
@@ -349,21 +350,21 @@ consume_resource(TSCont cont, TSEvent event ATS_UNUSED, void *edata ATS_UNUSED)
         case TS_EVENT_VCONN_INACTIVITY_TIMEOUT:
             if (event == TS_EVENT_VCONN_INACTIVITY_TIMEOUT)
             {
-                TSDebug(LOG_PREFIX, "Inactivity Timeout");
-                TSDebug(LOG_PREFIX, "TSVConnAbort()");
+                TSLogDebug("Inactivity Timeout");
+                TSLogDebug("TSVConnAbort()");
                 TSVConnAbort(vconn, TS_VC_CLOSE_ABORT);
             }
             else
             {
                 if (event == TS_EVENT_VCONN_READ_COMPLETE)
                 {
-                    TSDebug(LOG_PREFIX, "Read Complete");
+                    TSLogDebug("Read Complete");
                 }
                 else if (event == TS_EVENT_VCONN_EOS)
                 {
-                    TSDebug(LOG_PREFIX, "EOS");
+                    TSLogDebug("EOS");
                 }
-                TSDebug(LOG_PREFIX, "TSVConnClose()");
+                TSLogDebug("TSVConnClose()");
                 TSVConnClose(state->vconn);
             }
 
@@ -380,18 +381,18 @@ consume_resource(TSCont cont, TSEvent event ATS_UNUSED, void *edata ATS_UNUSED)
             TSVIONDoneSet(state->r_vio, TSVIONDoneGet(state->r_vio) + avail);
             if (state->async_req)
             {
-                TSDebug(LOG_PREFIX, "Unlock URL");
+                TSLogDebug("Unlock URL");
                 TSMutexLock(troot_mutex);
                 tdelete(state->req_info->effective_url, &troot, xstrcmp);
                 TSMutexUnlock(troot_mutex);
             }
             else
             {
-                TSDebug(LOG_PREFIX, "In sync path. setting fresh and re-enabling");
+                TSLogDebug("In sync path. setting fresh and re-enabling");
                 TSHttpTxnCacheLookupCountGet(state->txn, &lookup_count);
                 if ((state->resp_info->status == 500) || ((state->resp_info->status >= 502) && (state->resp_info->status <= 504)) || lookup_count > 2)
                 {
-                    TSDebug(LOG_PREFIX, "Sending stale data as fresh");
+                    TSLogDebug("Sending stale data as fresh");
                     if (log_info.object && (log_info.all || log_info.stale_if_error))
                     {
                         CachedHeaderInfo *chi = get_cached_header_info(state->txn);
@@ -403,7 +404,7 @@ consume_resource(TSCont cont, TSEvent event ATS_UNUSED, void *edata ATS_UNUSED)
                 }
                 else
                 {
-                    TSDebug(LOG_PREFIX, "Attempting new cache lookup");
+                    TSLogDebug("Attempting new cache lookup");
                     TSHttpHdrUrlGet(state->req_info->buf, state->req_info->http_hdr_loc, &url_loc);
                     TSHttpTxnNewCacheLookupDo(state->txn, state->req_info->buf, url_loc);
                     TSHandleMLocRelease(state->req_info->buf, state->req_info->http_hdr_loc, url_loc);
@@ -422,15 +423,15 @@ consume_resource(TSCont cont, TSEvent event ATS_UNUSED, void *edata ATS_UNUSED)
             TSIOBufferReaderFree(state->resp_io_buf_reader);
             TSIOBufferDestroy(state->resp_io_buf);
             TSfree(state);
-            TSDebug(LOG_PREFIX, "Destroying Cont");
+            TSLogDebug("Destroying Cont");
             TSContDestroy(cont);
             break;
         default:
-            TSError("Unknown event %d.", event);
+            TSLogError("Unknown event %d.", event);
             break;
     }
 
-    TSDebug(LOG_PREFIX, "Leaving consume_resource");
+    TSLogDebug("Leaving consume_resource");
     return 0;
 }
 
@@ -442,18 +443,18 @@ fetch_resource(TSCont cont, TSEvent event ATS_UNUSED, void *edata ATS_UNUSED)
     //struct sockaddr_in client_addr;
     TSMLoc connection_hdr_loc, connection_hdr_dup_loc;
 
-    TSDebug(LOG_PREFIX, "Entering fetch_resource");
+    TSLogDebug("Entering fetch_resource");
 
     state = (StateInfo *) TSContDataGet(cont);
 
-    TSDebug(LOG_PREFIX, "state: %p", state);
+    TSLogDebug("state: %p", state);
 
     //li = (RequestInfo *) edata;
     TSMutexLock(troot_mutex);
     // If already doing async lookup lets just close shop and go home
     if (state->async_req && (tfind(state->req_info->effective_url, &troot, xstrcmp) != NULL))
     {
-        TSDebug(LOG_PREFIX, "Looks like an async is already in progress");
+        TSLogDebug("Looks like an async is already in progress");
         TSMutexUnlock(troot_mutex);
         free_request_info(state->req_info);
         TSfree(state);
@@ -461,11 +462,11 @@ fetch_resource(TSCont cont, TSEvent event ATS_UNUSED, void *edata ATS_UNUSED)
     // Otherwise lets do the lookup!
     else
     {
-        TSDebug(LOG_PREFIX, "Lets do the lookup");
+        TSLogDebug("Lets do the lookup");
         if (state->async_req)
         {
             // Lock in tree
-            TSDebug(LOG_PREFIX, "Locking URL");
+            TSLogDebug("Locking URL");
             tsearch(state->req_info->effective_url, &troot, xstrcmp);
         }
         TSMutexUnlock(troot_mutex);
@@ -481,12 +482,12 @@ fetch_resource(TSCont cont, TSEvent event ATS_UNUSED, void *edata ATS_UNUSED)
             state->resp_info = create_response_info();
         }
 
-        TSDebug(LOG_PREFIX, "Set Connection: close");
+        TSLogDebug("Set Connection: close");
         connection_hdr_loc = TSMimeHdrFieldFind(state->req_info->buf, state->req_info->http_hdr_loc, TS_MIME_FIELD_CONNECTION, TS_MIME_LEN_CONNECTION);
 
         while(connection_hdr_loc != TS_NULL_MLOC)
         {
-            TSDebug(LOG_PREFIX, "Found old Connection hdr");
+            TSLogDebug("Found old Connection hdr");
 
             connection_hdr_dup_loc = TSMimeHdrFieldNextDup(state->req_info->buf, state->req_info->http_hdr_loc, connection_hdr_loc);
             TSMimeHdrFieldRemove(state->req_info->buf, state->req_info->http_hdr_loc, connection_hdr_loc);
@@ -496,43 +497,43 @@ fetch_resource(TSCont cont, TSEvent event ATS_UNUSED, void *edata ATS_UNUSED)
         }
 
         // This seems to have little effect
-        TSDebug(LOG_PREFIX, "Creating Connection hdr");
+        TSLogDebug("Creating Connection hdr");
         TSMimeHdrFieldCreateNamed(state->req_info->buf, state->req_info->http_hdr_loc, TS_MIME_FIELD_CONNECTION, TS_MIME_LEN_CONNECTION, &connection_hdr_loc);
         TSMimeHdrFieldValueStringInsert(state->req_info->buf, state->req_info->http_hdr_loc, connection_hdr_loc, -1, TS_HTTP_VALUE_CLOSE, TS_HTTP_LEN_CLOSE);
         TSMimeHdrFieldAppend(state->req_info->buf, state->req_info->http_hdr_loc, connection_hdr_loc);
         TSHandleMLocRelease(state->req_info->buf, state->req_info->http_hdr_loc, connection_hdr_loc);
 
         /*
-        TSDebug(LOG_PREFIX, "Creating @RFC5861 header");
+        TSLogDebug("Creating @RFC5861 header");
         TSMimeHdrFieldCreateNamed(state->req_info->buf, state->req_info->http_hdr_loc, TS_MIME_FIELD_CONNECTION, TS_MIME_LEN_CONNECTION, &connection_hdr_loc);
         TSMimeHdrFieldValueStringInsert(state->req_info->buf, state->req_info->http_hdr_loc, connection_hdr_loc, -1, TS_HTTP_VALUE_CLOSE, TS_HTTP_LEN_CLOSE);
         TSMimeHdrFieldAppend(state->req_info->buf, state->req_info->http_hdr_loc, connection_hdr_loc);
         TSHandleMLocRelease(state->req_info->buf, state->req_info->http_hdr_loc, connection_hdr_loc);
         */
 
-        TSDebug(LOG_PREFIX, "Create Buffers");
+        TSLogDebug("Create Buffers");
         state->req_io_buf = TSIOBufferCreate();
         state->req_io_buf_reader = TSIOBufferReaderAlloc(state->req_io_buf);
         state->resp_io_buf = TSIOBufferCreate();
         state->resp_io_buf_reader = TSIOBufferReaderAlloc(state->resp_io_buf);
 
-        TSDebug(LOG_PREFIX, "HdrPrint()");
+        TSLogDebug("HdrPrint()");
         TSHttpHdrPrint(state->req_info->buf, state->req_info->http_hdr_loc, state->req_io_buf);
         TSIOBufferWrite(state->req_io_buf, "\r\n", 2);
 
-        TSDebug(LOG_PREFIX, "TSHttpConnect()");
+        TSLogDebug("TSHttpConnect()");
         //memmove((void *) &client_addr, (void *) state->req_info->client_addr, sizeof(struct sockaddr));
-        //TSDebug(LOG_PREFIX, "client_addr: %s:%d", inet_ntoa(client_addr.sin_addr), client_addr.sin_port);
+        //TSLogDebug("client_addr: %s:%d", inet_ntoa(client_addr.sin_addr), client_addr.sin_port);
         state->vconn = TSHttpConnect((struct sockaddr const *) state->req_info->client_addr);
 
-        TSDebug(LOG_PREFIX, "TSVConnRead()");
+        TSLogDebug("TSVConnRead()");
         state->r_vio = TSVConnRead(state->vconn, consume_cont, state->resp_io_buf, INT64_MAX);
-        TSDebug(LOG_PREFIX, "TSVConnWrite()");
+        TSLogDebug("TSVConnWrite()");
         state->w_vio = TSVConnWrite(state->vconn, consume_cont, state->req_io_buf_reader, TSIOBufferReaderAvail(state->req_io_buf_reader));
     }
 
     TSContDestroy(cont);
-    TSDebug(LOG_PREFIX, "Leaving fetch_resource");
+    TSLogDebug("Leaving fetch_resource");
 
     return 0;
 }
@@ -549,26 +550,26 @@ rfc5861_plugin(TSCont cont, TSEvent event, void *edata)
     TSMLoc loc,warn_loc;
     TSHttpStatus http_status;
 
-    TSDebug(LOG_PREFIX, "Entering rfc5861_plugin");
+    TSLogDebug("Entering rfc5861_plugin");
     switch (event)
     {
         // Is this the proper event?
         case TS_EVENT_HTTP_READ_REQUEST_HDR:
-            TSDebug(LOG_PREFIX, "Event: TS_EVENT_HTTP_READ_REQUEST_HDR");
+            TSLogDebug("Event: TS_EVENT_HTTP_READ_REQUEST_HDR");
 
             if (TSHttpIsInternalRequest(txn) != TS_SUCCESS)
             {
-                TSDebug(LOG_PREFIX, "External Request");
+                TSLogDebug("External Request");
                 state = TSmalloc(sizeof(StateInfo));
                 time(&state->txn_start);
                 state->req_info = create_request_info(txn);
-                TSDebug(LOG_PREFIX, "state after TSmalloc: %p", state);
+                TSLogDebug("state after TSmalloc: %p", state);
                 TSHttpTxnArgSet(txn, txn_slot, (void *) state);
                 TSHttpTxnHookAdd(txn, TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK, cont);
             }
             else
             {
-                TSDebug(LOG_PREFIX, "Internal Request"); // This is insufficient if there are other plugins using TSHttpConnect
+                TSLogDebug("Internal Request"); // This is insufficient if there are other plugins using TSHttpConnect
                 //TSHttpTxnHookAdd(txn, TS_HTTP_CACHE_LOOKUP_COMPLETE_HOOK, cont);
                 TSHttpTxnHookAdd(txn, TS_HTTP_READ_RESPONSE_HDR_HOOK, cont);
                 // This might be needed in 3.2.0 to fix a timeout issue
@@ -577,25 +578,25 @@ rfc5861_plugin(TSCont cont, TSEvent event, void *edata)
             }
 
             TSHttpTxnReenable(txn, TS_EVENT_HTTP_CONTINUE);
-            TSDebug(LOG_PREFIX, "TS_EVENT_HTTP_READ_REQUEST_HDR Event Handler End");
+            TSLogDebug("TS_EVENT_HTTP_READ_REQUEST_HDR Event Handler End");
             break;
         case TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE:
-            TSDebug(LOG_PREFIX, "Event: TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE");
+            TSLogDebug("Event: TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE");
             state = (StateInfo *) TSHttpTxnArgGet(txn, txn_slot);
             TSHttpTxnCacheLookupCountGet(txn, &lookup_count);
-            TSDebug(LOG_PREFIX, "state after arg get: %p", state);
+            TSLogDebug("state after arg get: %p", state);
             if (TSHttpTxnCacheLookupStatusGet(txn, &status) == TS_SUCCESS)
             {
                 // Are we stale?
                 if (status == TS_CACHE_LOOKUP_HIT_STALE)
                 {
-                    TSDebug(LOG_PREFIX, "CacheLookupStatus is STALE");
+                    TSLogDebug("CacheLookupStatus is STALE");
                     // Get headers
                     chi = get_cached_header_info(txn);
 
                     if ((state->txn_start - chi->date) < (chi->max_age + chi->stale_while_revalidate))
                     {
-                        TSDebug(LOG_PREFIX, "Looks like we can return fresh info and validate in the background");
+                        TSLogDebug("Looks like we can return fresh info and validate in the background");
                         if (log_info.object && (log_info.all || log_info.stale_while_revalidate))
                             TSTextLogObjectWrite(log_info.object, "stale-while-revalidate: %d - %d < %d + %d %s", (int) state->txn_start, (int) chi->date, (int) chi->max_age, (int) chi->stale_while_revalidate, state->req_info->effective_url);
                         // lookup async
@@ -606,23 +607,23 @@ rfc5861_plugin(TSCont cont, TSEvent event, void *edata)
                         // Set warning header
                         TSHttpTxnHookAdd(txn, TS_HTTP_SEND_RESPONSE_HDR_HOOK, cont);
 
-                        TSDebug(LOG_PREFIX, "set state as async");
+                        TSLogDebug("set state as async");
                         state->async_req = true;
-                        TSDebug(LOG_PREFIX, "TSHttpTxnCacheLookupStatusSet()");
+                        TSLogDebug("TSHttpTxnCacheLookupStatusSet()");
                         TSHttpTxnCacheLookupStatusSet(txn, TS_CACHE_LOOKUP_HIT_FRESH);
                         //TSHttpTxnReenable(txn, TS_EVENT_HTTP_CONTINUE);
-                        TSDebug(LOG_PREFIX, "TSContCreate()");
+                        TSLogDebug("TSContCreate()");
                         fetch_cont = TSContCreate(fetch_resource, NULL);
-                        TSDebug(LOG_PREFIX, "TSContDataSet()");
+                        TSLogDebug("TSContDataSet()");
                         TSContDataSet(fetch_cont, (void *) state);
-                        TSDebug(LOG_PREFIX, "state: %p", state);
+                        TSLogDebug("state: %p", state);
                         TSContSchedule(fetch_cont, 0, TS_THREAD_POOL_TASK);
-                        TSDebug(LOG_PREFIX, "TSHttpTxnReenable()");
+                        TSLogDebug("TSHttpTxnReenable()");
                         TSHttpTxnReenable(txn, TS_EVENT_HTTP_CONTINUE);
                     }
                     else if ((state->txn_start - chi->date) < (chi->max_age + chi->stale_on_error))
                     {
-                        TSDebug(LOG_PREFIX, "Looks like we can return fresh data on 500 error");
+                        TSLogDebug("Looks like we can return fresh data on 500 error");
 #if (TS_VERSION_NUMBER >= 3003000)
                         TSHttpTxnConfigIntSet(txn, TS_CONFIG_HTTP_INSERT_AGE_IN_RESPONSE, 1);
 #endif
@@ -636,7 +637,8 @@ rfc5861_plugin(TSCont cont, TSEvent event, void *edata)
                     }
                     else
                     {
-                        TSDebug(LOG_PREFIX, "No love? now: %d date: %d max-age: %d swr: %d soe: %d", (int) state->txn_start, (int) chi->date, (int) chi->max_age, (int) chi->stale_while_revalidate, (int) chi->stale_on_error);
+                        TSLogDebug("No love? now: %d date: %d max-age: %d swr: %d soe: %d", (int) state->txn_start,
+                                   (int) chi->date, (int) chi->max_age, (int) chi->stale_while_revalidate, (int) chi->stale_on_error);
                         if (lookup_count == 1)
                         {
                             free_request_info(state->req_info);
@@ -649,7 +651,7 @@ rfc5861_plugin(TSCont cont, TSEvent event, void *edata)
                 }
                 else
                 {
-                    TSDebug(LOG_PREFIX, "Not Stale!");
+                    TSLogDebug("Not Stale!");
                     if (lookup_count == 1)
                     {
                         free_request_info(state->req_info);
@@ -660,7 +662,7 @@ rfc5861_plugin(TSCont cont, TSEvent event, void *edata)
             }
             else
             {
-                TSDebug(LOG_PREFIX, "Could not get CacheLookupStatus");
+                TSLogDebug("Could not get CacheLookupStatus");
                 if (lookup_count == 1)
                 {
                     free_request_info(state->req_info);
@@ -668,15 +670,15 @@ rfc5861_plugin(TSCont cont, TSEvent event, void *edata)
                 }
                 TSHttpTxnReenable(txn, TS_EVENT_HTTP_CONTINUE);
             }
-            TSDebug(LOG_PREFIX, "TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE Event Handler End");
+            TSLogDebug("TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE Event Handler End");
             break;
         case TS_EVENT_HTTP_READ_RESPONSE_HDR:
-            TSDebug(LOG_PREFIX, "Event: TS_EVENT_HTTP_READ_RESPONSE_HDR");
+            TSLogDebug("Event: TS_EVENT_HTTP_READ_RESPONSE_HDR");
             TSHttpTxnServerRespGet(txn, &buf, &loc);
             http_status = TSHttpHdrStatusGet(buf, loc);
             if ((http_status == 500) || ((http_status >= 502) && (http_status <= 504))) // 500, 502, 503, or 504
             {
-                TSDebug(LOG_PREFIX, "Set non-cachable");
+                TSLogDebug("Set non-cachable");
 #if (TS_VERSION_NUMBER >= 3003000)
                 TSHttpTxnServerRespNoStoreSet(txn,1);
 #else
@@ -685,11 +687,11 @@ rfc5861_plugin(TSCont cont, TSEvent event, void *edata)
             }
             TSHandleMLocRelease(buf, TS_NULL_MLOC, loc);
             TSHttpTxnReenable(txn, TS_EVENT_HTTP_CONTINUE);
-            TSDebug(LOG_PREFIX, "TS_EVENT_HTTP_READ_RESPONSE_HDR Event Handler End");
+            TSLogDebug("TS_EVENT_HTTP_READ_RESPONSE_HDR Event Handler End");
             break;
         case TS_EVENT_HTTP_SEND_RESPONSE_HDR:
-            TSDebug(LOG_PREFIX, "Event: TS_EVENT_HTTP_SEND_RESPONSE_HDR");
-            TSDebug(LOG_PREFIX, "set warning header");
+            TSLogDebug("Event: TS_EVENT_HTTP_SEND_RESPONSE_HDR");
+            TSLogDebug("set warning header");
             TSHttpTxnClientRespGet(txn, &buf, &loc);
             TSMimeHdrFieldCreateNamed(buf, loc, TS_MIME_FIELD_WARNING, TS_MIME_LEN_WARNING, &warn_loc);
             TSMimeHdrFieldValueStringInsert(buf, loc, warn_loc, -1, HTTP_VALUE_STALE_WARNING, strlen(HTTP_VALUE_STALE_WARNING));
@@ -697,14 +699,14 @@ rfc5861_plugin(TSCont cont, TSEvent event, void *edata)
             TSHandleMLocRelease(buf, loc, warn_loc);
             TSHandleMLocRelease(buf, TS_NULL_MLOC, loc);
             TSHttpTxnReenable(txn, TS_EVENT_HTTP_CONTINUE);
-            TSDebug(LOG_PREFIX, "TS_EVENT_HTTP_SEND_RESPONSE_HDR Event Handler End");
+            TSLogDebug("TS_EVENT_HTTP_SEND_RESPONSE_HDR Event Handler End");
             break;
         default:
             TSHttpTxnReenable(txn, TS_EVENT_HTTP_CONTINUE);
             break;
     }
 
-    TSDebug(LOG_PREFIX, "Leaving rfc5861_plugin");
+    TSLogDebug("Leaving rfc5861_plugin");
 
     return 0;
 }
@@ -721,12 +723,12 @@ TSPluginInit (int argc, const char *argv[])
 
     if (TSPluginRegister(TS_SDK_VERSION_3_0 , &info) != TS_SUCCESS)
     {
-        TSError("Plugin registration failed.\n");
+        TSLogError("Plugin registration failed.\n");
         return;
     }
     else
     {
-        TSDebug(LOG_PREFIX, "Plugin registration succeeded.\n");
+        TSLogDebug("Plugin registration succeeded.\n");
     }
 
     if (argc > 1)
@@ -771,5 +773,5 @@ TSPluginInit (int argc, const char *argv[])
     main_cont = TSContCreate(rfc5861_plugin, NULL);
     TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, main_cont);
 
-    TSDebug(LOG_PREFIX, "Plugin Init Complete.\n");
+    TSLogDebug("Plugin Init Complete.\n");
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/experimental/spdy/lib/base/logging.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/spdy/lib/base/logging.h b/plugins/experimental/spdy/lib/base/logging.h
index a4c065a..32b520a 100644
--- a/plugins/experimental/spdy/lib/base/logging.h
+++ b/plugins/experimental/spdy/lib/base/logging.h
@@ -21,18 +21,8 @@
 
 #include <string>
 
-extern "C" {
-
-// TS logging APIs don't get format attributes, so make sure we have a
-// compatible forward declaration.
-void TSDebug(const char *, const char *, ...)
-    __attribute__((format(printf, 2, 3)));
-
-void TSError(const char *, ...)
-    __attribute__((format(printf, 1, 2)));
-
-int TSIsDebugTagSet(const char*);
-}
+#define PLUGIN_NAME "spdy"
+#include <ts/debug.h>
 
 template <typename T> std::string stringof(const T&);
 #define cstringof(x) stringof(x).c_str()
@@ -45,8 +35,6 @@ template <typename T> std::string stringof(const T&);
 
 #define debug_protocol(fmt, ...) \
     debug_tag("spdy.protocol", "%s:%d " fmt, __func__, __LINE__, ##__VA_ARGS__)
-#define debug_plugin(fmt, ...) \
-    debug_tag("spdy.plugin", "%s:%d " fmt, __func__, __LINE__, ##__VA_ARGS__)
 #define debug_http(fmt, ...) \
     debug_tag("spdy.http", "%s:%d " fmt, __func__, __LINE__, ##__VA_ARGS__)
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/experimental/spdy/spdy.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/spdy/spdy.cc b/plugins/experimental/spdy/spdy.cc
index 1a83e2a..91d1876 100644
--- a/plugins/experimental/spdy/spdy.cc
+++ b/plugins/experimental/spdy/spdy.cc
@@ -172,7 +172,7 @@ dispatch_spdy_control_frame(
         break;
     default:
         // SPDY 2.2.1 - MUST ignore unrecognized control frames
-        TSError("[spdy] ignoring invalid control frame type %u", header.control.type);
+        TSLogError("ignoring invalid control frame type %u", header.control.type);
     }
 
     io->reenable();
@@ -217,14 +217,14 @@ next_frame:
         // This should not fail because we only try to consume the header when
         // there are enough bytes to read the header. Experimentally, however,
         // it does fail. I wonder why.
-        TSError("TSIOBufferBlockReadStart failed unexpectedly");
+        TSLogError("TSIOBufferBlockReadStart failed unexpectedly");
         return;
     }
 
     if (nbytes < spdy::message_header::size) {
         // We should never get here, because we check for space before
         // entering. Unfortunately this does happen :(
-        debug_plugin("short read %" PRId64 " bytes, expected at least %u, real count %zu",
+        TSLogDebug("short read %" PRId64 " bytes, expected at least %u, real count %zu",
                 nbytes, spdy::message_header::size,
                 count_bytes_available(io->input.reader));
         return;
@@ -235,7 +235,7 @@ next_frame:
 
     if (header.is_control) {
         if (header.control.version != spdy::PROTOCOL_VERSION) {
-            TSError("[spdy] client is version %u, but we implement version %u",
+            TSLogError("client is version %u, but we implement version %u",
                 header.control.version, spdy::PROTOCOL_VERSION);
         }
     } else {
@@ -257,7 +257,7 @@ next_frame:
         if (header.is_control) {
             dispatch_spdy_control_frame(header, io, ptr);
         } else {
-            TSError("[spdy] no data frame support yet");
+            TSLogError("no data frame support yet");
         }
 
         if (TSIOBufferReaderAvail(io->input.reader) >= spdy::message_header::size) {
@@ -281,14 +281,14 @@ spdy_vconn_io(TSCont contp, TSEvent ev, void * edata)
 
     // Experimentally, we recieve the read or write TSVIO pointer as the
     // callback data.
-    //debug_plugin("received IO event %s, VIO=%p", cstringof(ev), vio);
+    //TSLogDebug("received IO event %s, VIO=%p", cstringof(ev), vio);
 
     switch (ev) {
     case TS_EVENT_VCONN_READ_READY:
     case TS_EVENT_VCONN_READ_COMPLETE:
         io = spdy_io_control::get(contp);
         nbytes = TSIOBufferReaderAvail(io->input.reader);
-        debug_plugin("received %d bytes", nbytes);
+        TSLogDebug("received %d bytes", nbytes);
         if ((unsigned)nbytes >= spdy::message_header::size) {
             consume_spdy_frame(io);
         }
@@ -304,7 +304,7 @@ spdy_vconn_io(TSCont contp, TSEvent ev, void * edata)
     case TS_EVENT_VCONN_EOS: // fallthru
     default:
         if (ev != TS_EVENT_VCONN_EOS) {
-            debug_plugin("unexpected accept event %s", cstringof(ev));
+            TSLogDebug("unexpected accept event %s", cstringof(ev));
         }
         io = spdy_io_control::get(contp);
         TSVConnClose(io->vconn);
@@ -333,7 +333,7 @@ spdy_accept_io(TSCont contp, TSEvent ev, void * edata)
         debug_protocol("accepted new SPDY session %p", io);
         break;
     default:
-        debug_plugin("unexpected accept event %s", cstringof(ev));
+        TSLogDebug("unexpected accept event %s", cstringof(ev));
     }
 
     return TS_EVENT_NONE;
@@ -346,10 +346,10 @@ spdy_setup_protocol(TSCont /* contp ATS_UNUSED */, TSEvent ev, void * /* edata A
   case TS_EVENT_LIFECYCLE_PORTS_INITIALIZED:
     TSReleaseAssert(TSNetAcceptNamedProtocol(TSContCreate(spdy_accept_io, TSMutexCreate()),
                                              TS_NPN_PROTOCOL_SPDY_2) == TS_SUCCESS);
-    debug_plugin("registered named protocol endpoint for %s", TS_NPN_PROTOCOL_SPDY_2);
+    TSLogDebug("registered named protocol endpoint for %s", TS_NPN_PROTOCOL_SPDY_2);
     break;
   default:
-    TSError("[spdy] Protocol registration failed");
+    TSLogError("Protocol registration failed");
     break;
   }
 
@@ -371,10 +371,10 @@ TSPluginInit(int argc, const char * argv[])
     info.support_email = (char *)"jamespeach@me.com";
 
     if (TSPluginRegister(TS_SDK_VERSION_3_0, &info) != TS_SUCCESS) {
-        TSError("[spdy] Plugin registration failed");
+        TSLogError("Plugin registration failed");
     }
 
-    debug_plugin("initializing");
+    TSLogDebug("initializing");
 
     for (;;) {
         switch (getopt_long(argc, (char * const *)argv, "s", longopts, NULL)) {
@@ -384,7 +384,7 @@ TSPluginInit(int argc, const char * argv[])
         case -1:
             goto init;
         default:
-            TSError("[spdy] usage: spdy.so [--system-resolver]");
+            TSLogError("usage: spdy.so [--system-resolver]");
         }
     }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/experimental/spdy/stream.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/spdy/stream.cc b/plugins/experimental/spdy/stream.cc
index b5a7474..9735895 100644
--- a/plugins/experimental/spdy/stream.cc
+++ b/plugins/experimental/spdy/stream.cc
@@ -246,7 +246,7 @@ spdy_stream_io(TSCont contp, TSEvent ev, void * edata)
         return TS_EVENT_NONE;
 
     default:
-        debug_plugin("unexpected stream event %s", cstringof(ev));
+        TSLogDebug("unexpected stream event %s", cstringof(ev));
     }
 
     return TS_EVENT_NONE;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/experimental/tcp_info/tcp_info.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/tcp_info/tcp_info.cc b/plugins/experimental/tcp_info/tcp_info.cc
index 8a9d98b..1958ff4 100644
--- a/plugins/experimental/tcp_info/tcp_info.cc
+++ b/plugins/experimental/tcp_info/tcp_info.cc
@@ -39,6 +39,9 @@
 #include <sys/time.h>
 #include <arpa/inet.h>
 
+#define PLUGIN_NAME "tcp_info"
+#include <ts/debug.h>
+
 struct Config {
   int sample;
   const char* log_file;
@@ -66,7 +69,7 @@ load_config() {
     snprintf(config_file, sizeof(config_file), "%s/%s/%s", install_dir, "conf", "tcp_info.config");
     file = fopen(config_file, "r");
   }
-  TSDebug("tcp_info", "config file name: %s", config_file);
+  TSLogDebug("config file name: %s", config_file);
   assert(file != NULL);
 
   // read and parse the lines
@@ -83,8 +86,8 @@ load_config() {
     }
 
     if (value != NULL) {
-      TSDebug("tcp_info", "config key: %s", line);
-      TSDebug("tcp_info", "config value: %s", value);
+      TSLogDebug("config key: %s", line);
+      TSLogDebug("config value: %s", value);
       if (strcmp(line, "sample") == 0) {
         config.sample = atoi(value);
       } else if (strcmp(line, "log_file") == 0) {
@@ -97,10 +100,10 @@ load_config() {
     }
   }
 
-  TSDebug("tcp_info", "sample: %d", config.sample);
-  TSDebug("tcp_info", "log filename: %s", config.log_file);
-  TSDebug("tcp_info", "log_level: %d", config.log_level);
-  TSDebug("tcp_info", "hook: %d", config.hook);
+  TSLogDebug("sample: %d", config.sample);
+  TSLogDebug("log filename: %s", config.log_file);
+  TSLogDebug("log_level: %d", config.log_level);
+  TSLogDebug("hook: %d", config.hook);
 
   config.log_fd = open(config.log_file, O_APPEND | O_CREAT | O_RDWR, 0666);
   assert(config.log_fd > 0);
@@ -169,8 +172,8 @@ log_tcp_info(const char* event_name, const char* client_ip, const char* server_i
 
   ssize_t wrote = write(config.log_fd, buffer, bytes);
   assert(wrote == bytes);
-  TSDebug("tcp_info", "wrote: %d bytes to file: %s", bytes, config.log_file);
-  TSDebug("tcp_info", "logging: %s", buffer);
+  TSLogDebug("wrote: %d bytes to file: %s", bytes, config.log_file);
+  TSLogDebug("logging: %s", buffer);
 }
 
 
@@ -203,14 +206,14 @@ tcp_info_hook(TSCont /* contp ATS_UNUSED */, TSEvent event, void *edata)
     return 0;
   }
 
-  TSDebug("tcp_info", "tcp_info_hook called, event: %s", event_name);
+  TSLogDebug("tcp_info_hook called, event: %s", event_name);
 
   struct tcp_info tcp_info;
   int tcp_info_len = sizeof(tcp_info);
   int fd;
 
   if (TSHttpSsnClientFdGet(ssnp, &fd) != TS_SUCCESS) {
-    TSDebug("tcp_info", "error getting the client socket fd");
+    TSLogDebug("error getting the client socket fd");
     goto done;
   }
 
@@ -222,11 +225,11 @@ tcp_info_hook(TSCont /* contp ATS_UNUSED */, TSEvent event, void *edata)
       int random = 0;
       if (config.sample < 1000) {
         random = rand() % 1000;
-        TSDebug("tcp_info", "random: %d, config.sample: %d", random, config.sample);
+        TSLogDebug("random: %d, config.sample: %d", random, config.sample);
       }
 
       if (random < config.sample) {
-        TSDebug("tcp_info", "got the tcp_info struture and now logging");
+        TSLogDebug("got the tcp_info struture and now logging");
 
         // get the client address
         const struct sockaddr *client_addr = TSHttpSsnClientAddrGet(ssnp); 
@@ -246,10 +249,10 @@ tcp_info_hook(TSCont /* contp ATS_UNUSED */, TSEvent event, void *edata)
         log_tcp_info(event_name, client_str, server_str, tcp_info);
       }
     } else {
-      TSDebug("tcp_info", "tcp_info length is the wrong size");
+      TSLogDebug("tcp_info length is the wrong size");
     }
   } else {
-    TSDebug("tcp_info", "error calling getsockopt()");
+    TSLogDebug("error calling getsockopt()");
   }
 
 done:
@@ -271,7 +274,7 @@ TSPluginInit(int, const char *[]) // int argc, const char *argv[]
   info.support_email = (char*)"dev@trafficserver.apache.org";
 
   if (TSPluginRegister(TS_SDK_VERSION_3_0, &info) != TS_SUCCESS)
-    TSError("Plugin registration failed. \n");
+    TSLogError("Plugin registration failed.");
 
   // load the configuration file
   load_config();
@@ -280,20 +283,20 @@ TSPluginInit(int, const char *[]) // int argc, const char *argv[]
   // TODO: need another hook before the socket is closed, keeping it in for now because it will be easier to change if or when another hook is added to ATS
   if ((config.hook & 1) != 0) {
     TSHttpHookAdd(TS_HTTP_SSN_START_HOOK, TSContCreate(tcp_info_hook, NULL));
-    TSDebug("tcp_info", "added hook to the start of the TCP connection");
+    TSLogDebug("added hook to the start of the TCP connection");
   }
   if ((config.hook & 2) != 0) {
     TSHttpHookAdd(TS_HTTP_TXN_START_HOOK, TSContCreate(tcp_info_hook, NULL));
-    TSDebug("tcp_info", "added hook to the close of the transaction");
+    TSLogDebug("added hook to the close of the transaction");
   }
   if ((config.hook & 4) != 0) {
     TSHttpHookAdd(TS_HTTP_SEND_RESPONSE_HDR_HOOK, TSContCreate(tcp_info_hook, NULL));
-    TSDebug("tcp_info", "added hook to the sending of the headers");
+    TSLogDebug("added hook to the sending of the headers");
   }
   if ((config.hook & 8) != 0) {
     TSHttpHookAdd(TS_HTTP_SSN_CLOSE_HOOK, TSContCreate(tcp_info_hook, NULL));
-    TSDebug("tcp_info", "added hook to the close of the TCP connection");
+    TSLogDebug("added hook to the close of the TCP connection");
   }
 
-  TSDebug("tcp_info", "tcp info module registered");
+  TSLogDebug("tcp info module registered");
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_filter/header_filter.cc
----------------------------------------------------------------------
diff --git a/plugins/header_filter/header_filter.cc b/plugins/header_filter/header_filter.cc
index 33713e9..8d1737d 100644
--- a/plugins/header_filter/header_filter.cc
+++ b/plugins/header_filter/header_filter.cc
@@ -69,8 +69,7 @@ cont_header_filter(TSCont /* contp ATS_UNUSED */, TSEvent event, void *edata)
       hook = TS_HTTP_SEND_RESPONSE_HDR_HOOK;
     break;
   default:
-    TSError("header_filter: unknown event for this plugin");
-    TSDebug(PLUGIN_NAME, "unknown event for this plugin");
+    TSLogError("Unknown event (%d) for this plugin", event);
     break;
   }
 
@@ -105,25 +104,25 @@ TSPluginInit(int argc, const char *argv[])
   info.support_email = const_cast<char*>("users@trafficserver.apache.org");
 
   if (TSPluginRegister(TS_SDK_VERSION_3_0 , &info) != TS_SUCCESS) {
-    TSError("header_filter: plugin registration failed.\n"); 
+    TSLogError("plugin registration failed."); 
   }
 
   // Parse the rules file
   if ((argc > 1)) {
     if (!global.parse_file(argv[1]))
-      TSError("header_filter: failed to parse configuration file");
+      TSLogError("failed to parse configuration file");
   }
 
   TSCont cont = TSContCreate(cont_header_filter, NULL);
 
   for (int i=TS_HTTP_READ_REQUEST_HDR_HOOK; i < TS_HTTP_LAST_HOOK; ++i) {
     if (global.supported_hook(static_cast<TSHttpHookID>(i))) {
-      TSDebug(PLUGIN_NAME, "Registering hook %d", i);
+      TSLogDebug("Registering hook %d", i);
       TSHttpHookAdd(static_cast<TSHttpHookID>(i), cont);
     }
   }
   if (TSHttpArgIndexReserve(PLUGIN_NAME, "Filter out headers in various hooks", &arg_idx) != TS_SUCCESS) {
-    TSError("header_filter: failed to reserve private data slot");
+    TSLogError("failed to reserve private data slot");
   }
 }
 
@@ -150,7 +149,7 @@ TSRemapInit(TSRemapInterface* api_info, char *errbuf, int errbuf_size)
     return TS_ERROR;
   }
 
-  TSDebug(PLUGIN_NAME, "remap plugin is successfully initialized");
+  TSLogInfo("remap plugin is successfully initialized");
   return TS_SUCCESS;                     /* success */
 }
 
@@ -159,7 +158,7 @@ TSReturnCode
 TSRemapNewInstance(int argc, char* argv[], void** ih, char* /* errbuf ATS_UNUSED */, int /* errbuf_size */)
 {
   if (argc < 3) {
-    TSError("Unable to create remap instance, need rules file");
+    TSLogError("Unable to create remap instance, need rules file");
     return TS_ERROR;
   } else {
     Rules* conf = new(Rules);
@@ -187,7 +186,7 @@ TSRemapStatus
 TSRemapDoRemap(void* ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
 {
   if (NULL == ih) {
-    TSDebug(PLUGIN_NAME, "No Rules configured, falling back to default mapping rule");
+    TSLogDebug("No Rules configured, falling back to default mapping rule");
   } else {
     Rules* confp = static_cast<Rules*>(ih);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_filter/lulu.h
----------------------------------------------------------------------
diff --git a/plugins/header_filter/lulu.h b/plugins/header_filter/lulu.h
index 24cc165..80c73f5 100644
--- a/plugins/header_filter/lulu.h
+++ b/plugins/header_filter/lulu.h
@@ -47,8 +47,8 @@
 #endif
 
 // Used for Debug etc.
-static const char* PLUGIN_NAME = "header_filter";
-static const char* PLUGIN_NAME_DBG = "header_filter_dbg";
+#define PLUGIN_NAME "header_filter"
+#include <ts/debug.h>
 
 // From google styleguide: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
 #define DISALLOW_COPY_AND_ASSIGN(TypeName)      \

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_filter/rules.cc
----------------------------------------------------------------------
diff --git a/plugins/header_filter/rules.cc b/plugins/header_filter/rules.cc
index 62c21cb..1257887 100644
--- a/plugins/header_filter/rules.cc
+++ b/plugins/header_filter/rules.cc
@@ -45,14 +45,14 @@ inline void
 add_header(TSMBuffer& reqp, TSMLoc& hdr_loc, const char* hdr, int hdr_len, const char* val, int val_len)
 {
   if (val_len <= 0) {
-    TSDebug(PLUGIN_NAME, "\tWould set header %s to an empty value, skipping", hdr);
+    TSLogDebug("\tWould set header %s to an empty value, skipping", hdr);
   } else {
     TSMLoc new_field;
 
     if (TS_SUCCESS == TSMimeHdrFieldCreateNamed(reqp, hdr_loc, hdr, hdr_len, &new_field)) {
       if (TS_SUCCESS == TSMimeHdrFieldValueStringInsert(reqp, hdr_loc, new_field, -1,  val, val_len))
         if (TS_SUCCESS == TSMimeHdrFieldAppend(reqp, hdr_loc, new_field))
-          TSDebug(PLUGIN_NAME, "\tAdded header %s: %s", hdr, val);
+          TSLogDebug("\tAdded header %s: %s", hdr, val);
       TSHandleMLocRelease(reqp, hdr_loc, new_field);
     }
   }
@@ -130,7 +130,7 @@ RulesEntry::execute(TSMBuffer& reqp, TSMLoc& hdr_loc) const
             nuke = false;
             first_set = false;
             if (TS_SUCCESS == TSMimeHdrFieldValueStringSet(reqp, hdr_loc, field, -1, _qualifier, _q_len))
-              TSDebug(PLUGIN_NAME, "\tSet header:  %s: %s", _header, _qualifier);
+              TSLogDebug("\tSet header:  %s: %s", _header, _qualifier);
           } else {
             // Nuke all other "duplicates" of this header
             nuke = true;
@@ -145,7 +145,7 @@ RulesEntry::execute(TSMBuffer& reqp, TSMLoc& hdr_loc) const
           nuke = !nuke;
         if (nuke) {
           if (TS_SUCCESS == TSMimeHdrFieldDestroy(reqp, hdr_loc, field))
-            TSDebug(PLUGIN_NAME, "\tDeleting header %.*s", static_cast<int>(_h_len), _header);
+            TSLogDebug("\tDeleting header %.*s", static_cast<int>(_h_len), _header);
         }
         TSHandleMLocRelease(reqp, hdr_loc, field);
         field = tmp;
@@ -158,7 +158,7 @@ RulesEntry::execute(TSMBuffer& reqp, TSMLoc& hdr_loc) const
 // Rules class implementations
 Rules::~Rules()
 {
-  TSDebug(PLUGIN_NAME_DBG, "Calling DTOR for Rules");
+  TSLogDebug("Calling DTOR for Rules");
 
   for (int i = 0; i < TS_HTTP_LAST_HOOK; ++i)
     delete _entries[i];
@@ -190,10 +190,10 @@ Rules::parse_file(const char* filename)
   // TODO: Should we support a 'default' prefix here for the rules?
   f.open(filename, std::ios::in);
   if (!f.is_open()) {
-    TSError("unable to open %s", filename);
+    TSLogError("unable to open %s", filename);
     return false;
   }
-  TSDebug(PLUGIN_NAME, "Parsing config file %s", filename);
+  TSLogDebug("Parsing config file %s", filename);
   while (!f.eof()) {
     bool inverse = false;
     int options = 0;
@@ -277,18 +277,18 @@ Rules::parse_file(const char* filename)
                 qualifier = line.substr(pos1+1, pos2-pos1-1);
                 if (line[pos2+1] == 'i')
                   options |= PCRE_CASELESS;
-                TSDebug(PLUGIN_NAME, "Adding '%s' to hook %d, type is %d, qualifier is %c %s (%c)",
+                TSLogDebug("Adding '%s' to hook %d, type is %d, qualifier is %c %s (%c)",
                         word.c_str(), hook, type, inverse ? '!' : ' ', qualifier.c_str(), options & PCRE_CASELESS ? 'i' : ' ');
                 add_entry(hook, word, qualifier, type, inverse, options);
               } else {
-                TSError("Missing trailing delimiter in qualifier");
+                TSLogError("Missing trailing delimiter in qualifier");
               }
             } else {
-              TSError("Missing leading delimiter in qualifier");
+              TSLogError("Missing leading delimiter in qualifier");
             }
           } else {
             // No qualifier, so we'll nuke this header for all values
-            TSDebug(PLUGIN_NAME, "Adding %s to hook %d (unqualified)", word.c_str(), hook);
+            TSLogDebug("Adding %s to hook %d (unqualified)", word.c_str(), hook);
             add_entry(hook, word);
           }
         }
@@ -308,7 +308,7 @@ Rules::execute(TSMBuffer& reqp, TSMLoc& hdr_loc, const TSHttpHookID hook) const
   if (_entries[hook]) {
     RulesEntry* n = _entries[hook];
 
-    TSDebug(PLUGIN_NAME, "Executing rules(s) for hook %d", hook);
+    TSLogDebug("Executing rules(s) for hook %d", hook);
     do {
       n->execute(reqp, hdr_loc);
     } while (NULL != (n = n->next()));

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_filter/rules.h
----------------------------------------------------------------------
diff --git a/plugins/header_filter/rules.h b/plugins/header_filter/rules.h
index 70e3756..a6d6335 100644
--- a/plugins/header_filter/rules.h
+++ b/plugins/header_filter/rules.h
@@ -78,16 +78,16 @@ public:
                             &erroffset,           // for error offset
                             NULL);                // use default character tables
         if (!_rex)
-          TSError("header_filter: PCRE failed on %s at offset %d: %s\n", _qualifier, erroffset, error);
+          TSLogError("PCRE failed on %s at offset %d: %s\n", _qualifier, erroffset, error);
       }
     }
 
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for RulesEntry, header is %s, qualifier is %s", _header, _qualifier);
+    TSLogDebug("Calling CTOR for RulesEntry, header is %s, qualifier is %s", _header, _qualifier);
   }
 
   ~RulesEntry()
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling DTOR for RulesEntry");
+    TSLogDebug("Calling DTOR for RulesEntry");
     delete _next; // Potentially "deep" recursion, but should be OK.
     if (_header)
       TSfree(_header);
@@ -127,7 +127,7 @@ class Rules
 public:
   Rules()
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for Rules");
+    TSLogDebug("Calling CTOR for Rules");
     memset(_entries, 0, sizeof(_entries));
   }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_rewrite/condition.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/condition.cc b/plugins/header_rewrite/condition.cc
index 5180962..9ee323c 100644
--- a/plugins/header_rewrite/condition.cc
+++ b/plugins/header_rewrite/condition.cc
@@ -60,7 +60,7 @@ Condition::initialize(Parser& p)
 
   if (p.mod_exist("OR")) {
     if (p.mod_exist("AND")) {
-      TSError("header_rewrite: Can't have both AND and OR in mods");
+      TSLogError("Can't have both AND and OR in mods");
     } else {
       _mods = static_cast<CondModifiers>(_mods | COND_OR);
     }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_rewrite/condition.h
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/condition.h b/plugins/header_rewrite/condition.h
index e832a87..9393ff0 100644
--- a/plugins/header_rewrite/condition.h
+++ b/plugins/header_rewrite/condition.h
@@ -52,7 +52,7 @@ public:
   Condition()
     : _qualifier(""), _cond_op(MATCH_EQUAL), _matcher(NULL), _mods(COND_NONE)
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for Condition");
+    TSLogDebug("Calling CTOR for Condition");
   }
 
   // Inline this, it's critical for speed (and only used twice)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_rewrite/conditions.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/conditions.cc b/plugins/header_rewrite/conditions.cc
index 84ad1f0..c541267 100644
--- a/plugins/header_rewrite/conditions.cc
+++ b/plugins/header_rewrite/conditions.cc
@@ -54,7 +54,7 @@ ConditionStatus::initialize_hooks() {
 
 bool
 ConditionStatus::eval(const Resources& res) {
-  TSDebug(PLUGIN_NAME, "Evaluating STATUS()"); // TODO: It'd be nice to get the args here ...
+  TSLogDebug("Evaluating STATUS()"); // TODO: It'd be nice to get the args here ...
   return static_cast<const Matchers<TSHttpStatus>*>(_matcher)->test(res.resp_status);
 }
 
@@ -62,7 +62,7 @@ ConditionStatus::eval(const Resources& res) {
 void
 ConditionStatus::append_value(std::string& s, const Resources& res) {
   s += boost::lexical_cast<std::string>(res.resp_status);
-  TSDebug(PLUGIN_NAME, "Appending STATUS(%d) to evaluation value -> %s", res.resp_status, s.c_str());
+  TSLogDebug("Appending STATUS(%d) to evaluation value -> %s", res.resp_status, s.c_str());
 }
 
 
@@ -87,7 +87,7 @@ ConditionRandom::initialize(Parser& p)
 
 bool
 ConditionRandom::eval(const Resources& /* res ATS_UNUSED */) {
-  TSDebug(PLUGIN_NAME, "Evaluating RANDOM(%d)", _max);
+  TSLogDebug("Evaluating RANDOM(%d)", _max);
   return static_cast<const Matchers<unsigned int>*>(_matcher)->test(rand_r(&_seed) % _max);
 }
 
@@ -96,7 +96,7 @@ void
 ConditionRandom::append_value(std::string& s, const Resources& /* res ATS_UNUSED */)
 {
   s += boost::lexical_cast<std::string>(rand_r(&_seed) % _max);
-  TSDebug(PLUGIN_NAME, "Appending RANDOM(%d) to evaluation value -> %s", _max, s.c_str());
+  TSLogDebug("Appending RANDOM(%d) to evaluation value -> %s", _max, s.c_str());
 }
 
 
@@ -133,7 +133,7 @@ ConditionAccess::eval(const Resources& /* res ATS_UNUSED */)
 
   gettimeofday(&tv, NULL);
 
-  TSDebug(PLUGIN_NAME, "Evaluating ACCESS(%s)", _qualifier.c_str());
+  TSLogDebug("Evaluating ACCESS(%s)", _qualifier.c_str());
   if (tv.tv_sec > _next) {
     // There is a small "race" here, where we could end up calling access() a few times extra. I think
     // that is OK, and not worth protecting with a lock.
@@ -186,10 +186,10 @@ ConditionHeader::append_value(std::string& s, const Resources& res)
 
   if (bufp && hdr_loc) {
     field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, _qualifier.c_str(), _qualifier.size());
-    TSDebug(PLUGIN_NAME, "Getting Header: %s, field_loc: %p", _qualifier.c_str(), field_loc);
+    TSLogDebug("Getting Header: %s, field_loc: %p", _qualifier.c_str(), field_loc);
     if (field_loc != NULL) {
       value = TSMimeHdrFieldValueStringGet(res.bufp, res.hdr_loc, field_loc, 0, &len);
-      TSDebug(PLUGIN_NAME, "Appending HEADER(%s) to evaluation value -> %.*s", _qualifier.c_str(), len, value);
+      TSLogDebug("Appending HEADER(%s) to evaluation value -> %.*s", _qualifier.c_str(), len, value);
       s.append(value, len);
       TSHandleMLocRelease(res.bufp, res.hdr_loc, field_loc);
     }
@@ -204,7 +204,7 @@ ConditionHeader::eval(const Resources& res)
 
   append_value(s, res);
   bool rval = static_cast<const Matchers<std::string>*>(_matcher)->test(s);
-  TSDebug(PLUGIN_NAME, "Evaluating HEADER(): %s - rval: %d", s.c_str(), rval);
+  TSLogDebug("Evaluating HEADER(): %s - rval: %d", s.c_str(), rval);
   return rval;
 }
 
@@ -225,7 +225,7 @@ ConditionPath::append_value(std::string& s, const Resources& res)
 { 
   int path_len = 0;
   const char *path = TSUrlPathGet(res._rri->requestBufp, res._rri->requestUrl, &path_len);
-  TSDebug(PLUGIN_NAME, "Appending PATH to evaluation value: %.*s", path_len, path);
+  TSLogDebug("Appending PATH to evaluation value: %.*s", path_len, path);
   s.append(path, path_len);
 }
 
@@ -235,11 +235,11 @@ ConditionPath::eval(const Resources& res)
   std::string s;
 
   if (NULL == res._rri) {
-    TSDebug(PLUGIN_NAME, "PATH requires remap initialization! Evaluating to false!");
+    TSLogDebug("PATH requires remap initialization! Evaluating to false!");
     return false;
   }
   append_value(s, res);
-  TSDebug(PLUGIN_NAME, "Evaluating PATH");
+  TSLogDebug("Evaluating PATH");
 
   return static_cast<const Matchers<std::string>*>(_matcher)->test(s);
 }
@@ -261,7 +261,7 @@ ConditionQuery::append_value(std::string& s, const Resources& res)
 {
   int query_len = 0;
   const char *query = TSUrlHttpQueryGet(res._rri->requestBufp, res._rri->requestUrl, &query_len);
-  TSDebug(PLUGIN_NAME, "Appending QUERY to evaluation value: %.*s", query_len, query);
+  TSLogDebug("Appending QUERY to evaluation value: %.*s", query_len, query);
   s.append(query, query_len);
 }
 
@@ -271,11 +271,11 @@ ConditionQuery::eval(const Resources& res)
   std::string s;
 
   if (NULL == res._rri) {
-    TSDebug(PLUGIN_NAME, "QUERY requires remap initialization! Evaluating to false!");
+    TSLogDebug("QUERY requires remap initialization! Evaluating to false!");
     return false;
   }
   append_value(s, res);
-  TSDebug(PLUGIN_NAME, "Evaluating QUERY - %s", s.c_str());
+  TSLogDebug("Evaluating QUERY - %s", s.c_str());
   return static_cast<const Matchers<std::string>*>(_matcher)->test(s);
 }
 
@@ -326,13 +326,13 @@ ConditionDBM::initialize(Parser& p)
     _file = _qualifier.substr(0, pos);
     //_dbm = mdbm_open(_file.c_str(), O_RDONLY, 0, 0, 0);
     // if (NULL != _dbm) {
-    //   TSDebug(PLUGIN_NAME, "Opened DBM file %s\n", _file.c_str());
+    //   TSLogDebug("Opened DBM file %s\n", _file.c_str());
     //   _key.set_value(_qualifier.substr(pos + 1));
     // } else {
-    //   TSError("Failed to open DBM file: %s", _file.c_str());
+    //   TSLogError("Failed to open DBM file: %s", _file.c_str());
     // }
   } else {
-    TSError("Malformed DBM condition");
+    TSLogError("Malformed DBM condition");
   }
 }
 
@@ -349,7 +349,7 @@ ConditionDBM::append_value(std::string& /* s ATS_UNUSED */, const Resources& /*
   // if (key.size() > 0) {
   //   datum k, v;
 
-  //   TSDebug(PLUGIN_NAME, "Looking up DBM(\"%s\")", key.c_str());
+  //   TSLogDebug("Looking up DBM(\"%s\")", key.c_str());
   //   k.dptr = const_cast<char*>(key.c_str());
   //   k.dsize = key.size();
 
@@ -357,7 +357,7 @@ ConditionDBM::append_value(std::string& /* s ATS_UNUSED */, const Resources& /*
   //   //v = mdbm_fetch(_dbm, k);
   //   TSMutexUnlock(_mutex);
   //   if (v.dsize > 0) {
-  //     TSDebug(PLUGIN_NAME, "Appending DBM(%.*s) to evaluation value -> %.*s", k.dsize, k.dptr, v.dsize, v.dptr);
+  //     TSLogDebug("Appending DBM(%.*s) to evaluation value -> %.*s", k.dsize, k.dptr, v.dsize, v.dptr);
   //     s.append(v.dptr, v.dsize);
   //   }
   // }
@@ -370,7 +370,7 @@ ConditionDBM::eval(const Resources& res)
   std::string s;
 
   append_value(s, res);
-  TSDebug(PLUGIN_NAME, "Evaluating DBM(%s, \"%s\")", _file.c_str(), s.c_str());
+  TSLogDebug("Evaluating DBM(%s, \"%s\")", _file.c_str(), s.c_str());
 
   return static_cast<const Matchers<std::string>*>(_matcher)->test(s);
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_rewrite/conditions.h
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/conditions.h b/plugins/header_rewrite/conditions.h
index 904533d..922550f 100644
--- a/plugins/header_rewrite/conditions.h
+++ b/plugins/header_rewrite/conditions.h
@@ -43,14 +43,14 @@ class ConditionTrue : public Condition
 public:
   ConditionTrue()
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionTrue");
+    TSLogDebug("Calling CTOR for ConditionTrue");
   }
 
   void append_value(std::string& s, const Resources& /* res ATS_UNUSED */) { s += "TRUE";  }
 
 protected:
   bool eval(const Resources& /* res ATS_UNUSED */) {
-    TSDebug(PLUGIN_NAME, "Evaluating TRUE()");
+    TSLogDebug("Evaluating TRUE()");
     return true;
   }
 
@@ -65,13 +65,13 @@ class ConditionFalse : public Condition
 public:
   ConditionFalse()
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionFalse");
+    TSLogDebug("Calling CTOR for ConditionFalse");
   }
   void append_value(std::string& s, const Resources& /* res ATS_UNUSED */) { s += "FALSE"; }
 
 protected:
   bool eval(const Resources& /* res ATS_UNUSED */) {
-    TSDebug(PLUGIN_NAME, "Evaluating FALSE()");
+    TSLogDebug("Evaluating FALSE()");
     return false;
   }
 
@@ -86,7 +86,7 @@ class ConditionStatus : public Condition
 public:
   ConditionStatus()
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionStatus");
+    TSLogDebug("Calling CTOR for ConditionStatus");
   }
   void initialize(Parser& p);
   void append_value(std::string& s, const Resources& res);
@@ -107,7 +107,7 @@ public:
   ConditionRandom()
     : _seed(0), _max(0)
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionRandom");
+    TSLogDebug("Calling CTOR for ConditionRandom");
   }
   void initialize(Parser& p);
   void append_value(std::string& s, const Resources& res);
@@ -130,7 +130,7 @@ public:
   ConditionAccess()
     : _next(0), _last(false)
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionAccess");
+    TSLogDebug("Calling CTOR for ConditionAccess");
   }
   void initialize(Parser& p);
   void append_value(std::string& s, const Resources& res);
@@ -153,7 +153,7 @@ public:
   explicit ConditionHeader(bool client = false)
     : _client(client)
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionHeader, client %d", client);
+    TSLogDebug("Calling CTOR for ConditionHeader, client %d", client);
   };
 
   void initialize(Parser& p);
@@ -174,7 +174,7 @@ class ConditionPath : public Condition
 public:
   explicit ConditionPath()
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionPath");
+    TSLogDebug("Calling CTOR for ConditionPath");
   };
 
   void initialize(Parser& p);
@@ -206,7 +206,7 @@ class ConditionQuery : public Condition
 public:
   explicit ConditionQuery()
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionQuery");
+    TSLogDebug("Calling CTOR for ConditionQuery");
   };
 
   void initialize(Parser& p);
@@ -228,7 +228,7 @@ public:
   explicit ConditionUrl(bool client = false)
     : _url_qual(URL_QUAL_NONE), _client(client)
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionUrl");
+    TSLogDebug("Calling CTOR for ConditionUrl");
   };
 
   void initialize(Parser& p);
@@ -256,7 +256,7 @@ public:
       _file("")
   {
     _mutex = TSMutexCreate();
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for ConditionDBM");
+    TSLogDebug("Calling CTOR for ConditionDBM");
   }
 
   ~ConditionDBM() {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_rewrite/factory.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/factory.cc b/plugins/header_rewrite/factory.cc
index d20fa40..b9a803e 100644
--- a/plugins/header_rewrite/factory.cc
+++ b/plugins/header_rewrite/factory.cc
@@ -50,7 +50,7 @@ operator_factory(const std::string& op)
   } else if (op == "no-op") {
     o = new OperatorNoOp();
   } else {
-    TSError("header_rewrite: unknown operator in header_rewrite: %s", op.c_str());
+    TSLogError("Unknown operator in header_rewrite: %s", op.c_str());
     return NULL;
   }
 
@@ -98,7 +98,7 @@ condition_factory(const std::string& cond)
   } else if (c_name == "DBM") {
     c = new ConditionDBM();
   } else {
-    TSError("header_rewrite: unknown condition in header_rewrite: %s",c_name.c_str());
+    TSLogError("unknown condition in header_rewrite: %s",c_name.c_str());
     return NULL;
   }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_rewrite/header_rewrite.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/header_rewrite.cc b/plugins/header_rewrite/header_rewrite.cc
index 1300742..35b6d19 100644
--- a/plugins/header_rewrite/header_rewrite.cc
+++ b/plugins/header_rewrite/header_rewrite.cc
@@ -32,9 +32,6 @@
 #include "resources.h"
 
 // "Defines"
-const char* PLUGIN_NAME = "header_rewrite";
-const char* PLUGIN_NAME_DBG = "header_rewrite_dbg";
-
 static const char* DEFAULT_CONF_PATH = "/usr/local/etc/header_rewrite/";
 
 
@@ -46,7 +43,7 @@ static ResourceIDs all_resids[TS_HTTP_LAST_HOOK+1];
 static bool
 add_rule(RuleSet* rule) {
   if (rule && rule->has_operator()) {
-    TSDebug(PLUGIN_NAME, "Adding rule to hook=%d\n", rule->get_hook());
+    TSLogDebug("Adding rule to hook=%d\n", rule->get_hook());
     if (NULL == all_rules[rule->get_hook()]) {
       all_rules[rule->get_hook()] = rule;
     } else {
@@ -82,18 +79,18 @@ parse_config(const std::string fname, TSHttpHookID default_hook)
 
   f.open(filename.c_str(), std::ios::in);
   if (!f.is_open()) {
-    TSError("header_rewrite: unable to open %s", filename.c_str());
+    TSLogError("Unable to open %s", filename.c_str());
     return false;
   }
 
-  TSDebug(PLUGIN_NAME, "Loading header_rewrite config from %s", filename.c_str());
+  TSLogDebug("Loading header_rewrite config from %s", filename.c_str());
 
   while (!f.eof()) {
     std::string line;
 
     getline(f, line);
     ++lineno; // ToDo: we should probably use this for error messages ...
-    TSDebug(PLUGIN_NAME, "Reading line: %d: %s", lineno, line.c_str());
+    TSLogDebug("Reading line: %d: %s", lineno, line.c_str());
 
     boost::trim(line);
     if (line.empty() || (line[0] == '#'))
@@ -156,7 +153,7 @@ parse_config(const std::string fname, TSHttpHookID default_hook)
 static int
 cont_rewrite_headers(TSCont contp, TSEvent event, void *edata)
 {
-  TSDebug(PLUGIN_NAME, "plugin: %d", event);
+  TSLogDebug("plugin: %d", event);
 
   TSHttpTxn txnp = (TSHttpTxn) edata;
   Resources res(txnp, contp);
@@ -181,8 +178,7 @@ cont_rewrite_headers(TSCont contp, TSEvent event, void *edata)
     hook = TS_HTTP_SEND_RESPONSE_HDR_HOOK;
     break;
   default:
-    TSError("header_rewrite: unknown event for this plugin");
-    TSDebug(PLUGIN_NAME, "unknown event for this plugin");
+    TSLogError("unknown event (%d) for this plugin", event);
     break;
   }
 
@@ -221,12 +217,12 @@ TSPluginInit(int argc, const char *argv[])
   info.support_email = (char*)"";
 
   if (TS_SUCCESS != TSPluginRegister(TS_SDK_VERSION_3_0 , &info)) {
-    TSError("header_rewrite: plugin registration failed.\n"); 
+    TSLogError("plugin registration failed."); 
   }
 
-  TSDebug(PLUGIN_NAME, "number of arguments: %d", argc);
+  TSLogDebug("number of arguments: %d", argc);
   if (argc != 2) {
-    TSError("usage: %s <config-file>\n", argv[0] );
+    TSLogError("usage: %s <config-file>", argv[0] );
     assert(argc == 2);
   }
 
@@ -240,12 +236,12 @@ TSPluginInit(int argc, const char *argv[])
   if (parse_config(argv[1], TS_HTTP_READ_RESPONSE_HDR_HOOK)) {
     for (int i=TS_HTTP_READ_REQUEST_HDR_HOOK; i<TS_HTTP_LAST_HOOK; ++i) {
       if (all_rules[i]) {
-        TSDebug(PLUGIN_NAME, "adding hook: %d", i);
+        TSLogDebug("adding hook: %d", i);
         TSHttpHookAdd(static_cast<TSHttpHookID>(i), TSContCreate(cont_rewrite_headers, NULL));
       }
     }
   } else {
-    TSError("header_rewrite: failed to parse configuration file");
+    TSLogError("Failed to parse configuration file");
   }
 }
 
@@ -272,7 +268,7 @@ TSRemapInit(TSRemapInterface *api_info, char *errbuf, int errbuf_size)
     return TS_ERROR;
   }
 
-  TSDebug(PLUGIN_NAME, "remap plugin is successfully initialized");
+  TSLogInfo("remap plugin is successfully initialized");
   return TS_SUCCESS;
 }
 
@@ -280,10 +276,10 @@ TSRemapInit(TSRemapInterface *api_info, char *errbuf, int errbuf_size)
 TSReturnCode
 TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSED */, int /* errbuf_size ATS_UNUSED */)
 {
-  TSDebug(PLUGIN_NAME, "initializing the remap plugin header_rewrite");
+  TSLogDebug("initializing the remap plugin header_rewrite");
 
   if (argc < 3) {
-    TSError("Unable to create remap instance, need config file");
+    TSLogError("Unable to create remap instance, need config file");
     return TS_ERROR;
   }
 
@@ -291,14 +287,14 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf ATS_UNUSE
   // remap instantiation.
   all_rules[TS_REMAP_PSEUDO_HOOK] = NULL;
   if (!parse_config(argv[2], TS_REMAP_PSEUDO_HOOK)) {
-    TSError("Unable to create remap instance");
+    TSLogError("Unable to create remap instance");
     return TS_ERROR;
   }
 
   *ih = all_rules[TS_REMAP_PSEUDO_HOOK];
   all_rules[TS_REMAP_PSEUDO_HOOK] = NULL;
 
-  TSDebug(PLUGIN_NAME, "successfully initialize the header_rewrite plugin");
+  TSLogInfo("successfully initialized plugin");
   return TS_SUCCESS;
 }
 
@@ -320,7 +316,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
   TSRemapStatus rval = TSREMAP_NO_REMAP;
 
   if (NULL == ih) {
-    TSDebug(PLUGIN_NAME, "No Rules configured, falling back to default");
+    TSLogDebug("No Rules configured, falling back to default");
     return rval;
   } else {
     RuleSet* rule = (RuleSet*)ih;
@@ -346,7 +342,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
 
   }
 
-  TSDebug(PLUGIN_NAME, "returing with status: %d", rval);
+  TSLogDebug("returing with status: %d", rval);
   return rval;
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_rewrite/lulu.h
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/lulu.h b/plugins/header_rewrite/lulu.h
index 99876ec..80bcafc 100644
--- a/plugins/header_rewrite/lulu.h
+++ b/plugins/header_rewrite/lulu.h
@@ -43,8 +43,8 @@
 #error "Define barriers"
 #endif
 
-extern const char* PLUGIN_NAME;
-extern const char* PLUGIN_NAME_DBG;
+#define PLUGIN_NAME "header_rewrite"
+#include <ts/debug.h>
 
 
 // From google styleguide: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_rewrite/matcher.h
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/matcher.h b/plugins/header_rewrite/matcher.h
index d9648c8..ae8fca6 100644
--- a/plugins/header_rewrite/matcher.h
+++ b/plugins/header_rewrite/matcher.h
@@ -48,11 +48,11 @@ public:
   explicit Matcher(const MatcherOps op)
     : _pdata(NULL), _op(op)
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for Matcher");
+    TSLogDebug("Calling CTOR for Matcher");
   }
 
   virtual ~Matcher() {
-    TSDebug(PLUGIN_NAME_DBG, "Calling DTOR for Matcher");
+    TSLogDebug("Calling DTOR for Matcher");
     free_pdata();
   }
 
@@ -86,7 +86,7 @@ public:
       std::cout<<"Invalid regex:failed to precompile"<<std::endl;
       abort();
     }
-    TSDebug(PLUGIN_NAME,"Regex precompiled successfully");
+    TSLogDebug("Regex precompiled successfully");
   }
 
   void setRegex(const unsigned int /* t ATS_UNUSED */) { return; }
@@ -148,10 +148,10 @@ private:
  }
   
   bool test_reg(const std::string t) const {
-      TSDebug(PLUGIN_NAME, "Test regular expression %s : %s", _data.c_str(), t.c_str());
+      TSLogDebug("Test regular expression %s : %s", _data.c_str(), t.c_str());
           int ovector[OVECCOUNT];
           if (helper.regexMatch(t.c_str(), t.length(), ovector) > 0) {
-              TSDebug(PLUGIN_NAME, "Successfully found regular expression match");
+              TSLogDebug("Successfully found regular expression match");
               return true;
     }
       return false;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_rewrite/operator.h
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/operator.h b/plugins/header_rewrite/operator.h
index f136290..db67202 100644
--- a/plugins/header_rewrite/operator.h
+++ b/plugins/header_rewrite/operator.h
@@ -48,7 +48,7 @@ public:
   Operator()
     : _mods(OPER_NONE)
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for Operator");
+    TSLogDebug("Calling CTOR for Operator");
   }
 
   void do_exec(const Resources& res) const {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_rewrite/operators.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/operators.cc b/plugins/header_rewrite/operators.cc
index 3775166..c2ab9c9 100644
--- a/plugins/header_rewrite/operators.cc
+++ b/plugins/header_rewrite/operators.cc
@@ -45,10 +45,10 @@ OperatorRMHeader::exec(const Resources& res) const
   TSMLoc field_loc, tmp;
 
   if (res.bufp && res.hdr_loc) {
-    TSDebug(PLUGIN_NAME, "OperatorRMHeader::exec() invoked on header %s", _header.c_str());
+    TSLogDebug("OperatorRMHeader::exec() invoked on header %s", _header.c_str());
     field_loc = TSMimeHdrFieldFind(res.bufp, res.hdr_loc, _header.c_str(), _header.size());
     while (field_loc) {
-      TSDebug(PLUGIN_NAME, "\tdeleting header %s", _header.c_str());
+      TSLogDebug("\tdeleting header %s", _header.c_str());
       tmp = TSMimeHdrFieldNextDup(res.bufp, res.hdr_loc, field_loc);
       TSMimeHdrFieldDestroy(res.bufp, res.hdr_loc, field_loc);
       TSHandleMLocRelease(res.bufp, res.hdr_loc, field_loc);
@@ -66,7 +66,7 @@ OperatorSetStatus::initialize(Parser& p) {
   _status.set_value(p.get_arg());
 
   if (NULL == (_reason = TSHttpHdrReasonLookup((TSHttpStatus)_status.get_int_value()))) {
-    TSError("header_rewrite: unknown status %d", _status.get_int_value());
+    TSLogError("unknown status %d", _status.get_int_value());
     _reason_len = 0;
   } else {
     _reason_len = strlen(_reason);
@@ -120,7 +120,7 @@ OperatorSetStatusReason::exec(const Resources& res) const {
 
     _reason.append_value(reason, res);
     if (reason.size() > 0) {
-      TSDebug(PLUGIN_NAME, "Setting Status Reason to %s", reason.c_str());
+      TSLogDebug("Setting Status Reason to %s", reason.c_str());
       TSHttpHdrReasonSet(res.bufp, res.hdr_loc, reason.c_str(), reason.size());
     }
   }
@@ -153,17 +153,17 @@ OperatorAddHeader::exec(const Resources& res) const
 
   // Never set an empty header (I don't think that ever makes sense?)
   if (value.empty()) {
-    TSDebug(PLUGIN_NAME, "Would set header %s to an empty value, skipping", _header.c_str());
+    TSLogDebug("Would set header %s to an empty value, skipping", _header.c_str());
     return;
   }
   
   if (res.bufp && res.hdr_loc) {
-    TSDebug(PLUGIN_NAME, "OperatorAddHeader::exec() invoked on header %s: %s", _header.c_str(), value.c_str());
+    TSLogDebug("OperatorAddHeader::exec() invoked on header %s: %s", _header.c_str(), value.c_str());
     TSMLoc field_loc;
     
     if (TS_SUCCESS == TSMimeHdrFieldCreateNamed(res.bufp, res.hdr_loc, _header.c_str(), _header.size(), &field_loc)) {
       if (TS_SUCCESS == TSMimeHdrFieldValueStringInsert(res.bufp, res.hdr_loc, field_loc, -1, value.c_str(), value.size())) {
-        TSDebug(PLUGIN_NAME, "   adding header %s", _header.c_str());
+        TSLogDebug("   adding header %s", _header.c_str());
         //INKHttpHdrPrint(res.bufp, res.hdr_loc, reqBuff);
         TSMimeHdrFieldAppend(res.bufp, res.hdr_loc, field_loc);
       }
@@ -198,35 +198,35 @@ OperatorSetDestination::exec(const Resources& res) const
     case URL_QUAL_HOST:
       _value.append_value(value, res);
       if (value.empty()) {
-        TSDebug(PLUGIN_NAME, "Would set destination HOST to an empty value, skipping");
+        TSLogDebug("Would set destination HOST to an empty value, skipping");
       } else {
         const_cast<Resources&>(res).changed_url = true;
         TSUrlHostSet(res._rri->requestBufp, res._rri->requestUrl, value.c_str(), value.size());
-        TSDebug(PLUGIN_NAME, "OperatorSetHost::exec() invoked with HOST: %s", value.c_str());
+        TSLogDebug("OperatorSetHost::exec() invoked with HOST: %s", value.c_str());
       }
       break;
 
     case URL_QUAL_PATH:
       _value.append_value(value, res);
       if (value.empty()) {
-        TSDebug(PLUGIN_NAME, "Would set destination PATH to an empty value, skipping");
+        TSLogDebug("Would set destination PATH to an empty value, skipping");
       } else {
         const_cast<Resources&>(res).changed_url = true;
         TSUrlPathSet(res._rri->requestBufp, res._rri->requestUrl, value.c_str(), value.size());
-        TSDebug(PLUGIN_NAME, "OperatorSetHost::exec() invoked with PATH: %s", value.c_str());
+        TSLogDebug("OperatorSetHost::exec() invoked with PATH: %s", value.c_str());
       }
       break;
 
     case URL_QUAL_QUERY:
       _value.append_value(value, res);
       if (value.empty()) {
-        TSDebug(PLUGIN_NAME, "Would set destination QUERY to an empty value, skipping");
+        TSLogDebug("Would set destination QUERY to an empty value, skipping");
       } else {
         //1.6.4--Support for preserving QSA in case of set-destination
         if (get_oper_modifiers() & OPER_QSA) {
           int query_len = 0;
           const char* query = TSUrlHttpQueryGet(res._rri->requestBufp, res._rri->requestUrl, &query_len);
-          TSDebug(PLUGIN_NAME, "QSA mode, append original query string: %.*s", query_len, query);
+          TSLogDebug("QSA mode, append original query string: %.*s", query_len, query);
           //std::string connector = (value.find("?") == std::string::npos)? "?" : "&";
           value.append("&");
           value.append(query, query_len);
@@ -234,17 +234,17 @@ OperatorSetDestination::exec(const Resources& res) const
 
         const_cast<Resources&>(res).changed_url = true;
         TSUrlHttpQuerySet(res._rri->requestBufp, res._rri->requestUrl, value.c_str(), value.size());
-        TSDebug(PLUGIN_NAME, "OperatorSetHost::exec() invoked with QUERY: %s", value.c_str());
+        TSLogDebug("OperatorSetHost::exec() invoked with QUERY: %s", value.c_str());
       }
       break;
 
     case URL_QUAL_PORT:
       if (_value.get_int_value() <= 0) {
-        TSDebug(PLUGIN_NAME, "Would set destination PORT to an invalid range, skipping");
+        TSLogDebug("Would set destination PORT to an invalid range, skipping");
       } else {
         const_cast<Resources&>(res).changed_url = true;
         TSUrlPortSet(res._rri->requestBufp, res._rri->requestUrl, _value.get_int_value());
-        TSDebug(PLUGIN_NAME, "OperatorSetHost::exec() invoked with PORT: %d", _value.get_int_value());
+        TSLogDebug("OperatorSetHost::exec() invoked with PORT: %d", _value.get_int_value());
       }
       break;
     case URL_QUAL_URL:
@@ -270,7 +270,7 @@ OperatorSetRedirect::initialize(Parser& p) {
 
   if ((_status.get_int_value() != (int)TS_HTTP_STATUS_MOVED_PERMANENTLY) &&
       (_status.get_int_value() != (int)TS_HTTP_STATUS_MOVED_TEMPORARILY)) {
-    TSError("header_rewrite: unsupported redirect status %d", _status.get_int_value());
+    TSLogError("Unsupported redirect status %d", _status.get_int_value());
   }
 
   require_resources(RSRC_SERVER_RESPONSE_HEADERS);
@@ -296,7 +296,7 @@ OperatorSetRedirect::exec(const Resources& res) const
           int path_len = 0;
           const char *path = TSUrlPathGet(res._rri->requestBufp, res._rri->requestUrl, &path_len);
           if (path_len > 0) {
-            TSDebug(PLUGIN_NAME, "Find %%{PATH} in redirect url, replace it with: %.*s", path_len, path);
+            TSLogDebug("Find %%{PATH} in redirect url, replace it with: %.*s", path_len, path);
             value.insert(pos_path, path, path_len);
           }
       }
@@ -305,7 +305,7 @@ OperatorSetRedirect::exec(const Resources& res) const
       int query_len = 0;
       const char *query = TSUrlHttpQueryGet(res._rri->requestBufp, res._rri->requestUrl, &query_len);
       if ((get_oper_modifiers() & OPER_QSA) && (query_len > 0)) {
-          TSDebug(PLUGIN_NAME, "QSA mode, append original query string: %.*s", query_len, query);
+          TSLogDebug("QSA mode, append original query string: %.*s", query_len, query);
           std::string connector = (value.find("?") == std::string::npos)? "?" : "&";
           value.append(connector);
           value.append(query, query_len);
@@ -316,7 +316,7 @@ OperatorSetRedirect::exec(const Resources& res) const
       const char *start = value.c_str();
       const char *end = value.size() + start;
       TSUrlParse(res._rri->requestBufp, res._rri->requestUrl, &start, end);
-      TSDebug(PLUGIN_NAME, "OperatorSetRedirect::exec() invoked with destination=%s and status code=%d", 
+      TSLogDebug("OperatorSetRedirect::exec() invoked with destination=%s and status code=%d", 
               value.c_str(), _status.get_int_value());
     }
     
@@ -341,7 +341,7 @@ OperatorSetTimeoutOut::initialize(Parser& p) {
     _type = TO_OUT_DNS;
   } else {
     _type = TO_OUT_UNDEFINED;
-    TSError("header_rewrite: unsupported timeout qualifier: %s", p.get_arg().c_str());
+    TSLogError("unsupported timeout qualifier: %s", p.get_arg().c_str());
   }
 
   _timeout.set_value(p.get_value());
@@ -353,26 +353,26 @@ OperatorSetTimeoutOut::exec(const Resources& res) const
 {
   switch (_type) {
   case TO_OUT_ACTIVE:
-    TSDebug(PLUGIN_NAME, "OperatorSetTimeoutOut::exec(active, %d)", _timeout.get_int_value());
+    TSLogDebug("OperatorSetTimeoutOut::exec(active, %d)", _timeout.get_int_value());
     TSHttpTxnActiveTimeoutSet(res.txnp, _timeout.get_int_value());
     break;
 
   case TO_OUT_INACTIVE:
-    TSDebug(PLUGIN_NAME, "OperatorSetTimeoutOut::exec(inactive, %d)", _timeout.get_int_value());
+    TSLogDebug("OperatorSetTimeoutOut::exec(inactive, %d)", _timeout.get_int_value());
     TSHttpTxnNoActivityTimeoutSet(res.txnp, _timeout.get_int_value());
     break;
 
   case TO_OUT_CONNECT:
-    TSDebug(PLUGIN_NAME, "OperatorSetTimeoutOut::exec(connect, %d)", _timeout.get_int_value());
+    TSLogDebug("OperatorSetTimeoutOut::exec(connect, %d)", _timeout.get_int_value());
     TSHttpTxnConnectTimeoutSet(res.txnp, _timeout.get_int_value());
     break;
 
   case TO_OUT_DNS:
-    TSDebug(PLUGIN_NAME, "OperatorSetTimeoutOut::exec(dns, %d)", _timeout.get_int_value());
+    TSLogDebug("OperatorSetTimeoutOut::exec(dns, %d)", _timeout.get_int_value());
     TSHttpTxnDNSTimeoutSet(res.txnp, _timeout.get_int_value());
     break;
   default:
-    TSError("header_rewrite: unsupported timeout");
+    TSLogError("unsupported timeout");
     break;
   }
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_rewrite/operators.h
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/operators.h b/plugins/header_rewrite/operators.h
index f43858f..b54732e 100644
--- a/plugins/header_rewrite/operators.h
+++ b/plugins/header_rewrite/operators.h
@@ -39,7 +39,7 @@ public:
   OperatorRMHeader()
     : _header("")
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for OperatorRMHeader");
+    TSLogDebug("Calling CTOR for OperatorRMHeader");
   }
   void initialize(Parser& p);
 
@@ -59,7 +59,7 @@ public:
   OperatorSetStatus()
     : _reason(NULL), _reason_len(0)
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for OperatorSetStatus");
+    TSLogDebug("Calling CTOR for OperatorSetStatus");
   }
   void initialize(Parser& p);
 
@@ -81,7 +81,7 @@ class OperatorSetStatusReason : public Operator
 public:
   OperatorSetStatusReason()
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for OperatorSetStatusReason");
+    TSLogDebug("Calling CTOR for OperatorSetStatusReason");
   }
   void initialize(Parser& p);
 
@@ -102,7 +102,7 @@ public:
   OperatorAddHeader()
     : _header("")
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for OperatorAddHeader");
+    TSLogDebug("Calling CTOR for OperatorAddHeader");
   }
   void initialize(Parser& p);
 
@@ -123,7 +123,7 @@ public:
   OperatorSetDestination()
     : _url_qual(URL_QUAL_NONE)
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for OperatorSetDestination");
+    TSLogDebug("Calling CTOR for OperatorSetDestination");
   }
   void initialize(Parser& p);
 
@@ -143,7 +143,7 @@ class OperatorSetRedirect : public Operator
 public:
   OperatorSetRedirect()
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for OperatorSetRedirect");
+    TSLogDebug("Calling CTOR for OperatorSetRedirect");
   }
   void initialize(Parser& p);
 
@@ -163,7 +163,7 @@ class OperatorNoOp : public Operator
 public:
   OperatorNoOp()
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for OperatorNoOp");
+    TSLogDebug("Calling CTOR for OperatorNoOp");
   }
 
 protected:
@@ -180,7 +180,7 @@ public:
   OperatorSetTimeoutOut()
     : _type(TO_OUT_UNDEFINED)
   {
-    TSDebug(PLUGIN_NAME_DBG, "Calling CTOR for OperatorSetTimeoutOut");
+    TSLogDebug("Calling CTOR for OperatorSetTimeoutOut");
   }
   void initialize(Parser& p);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/42306ff7/plugins/header_rewrite/parser.cc
----------------------------------------------------------------------
diff --git a/plugins/header_rewrite/parser.cc b/plugins/header_rewrite/parser.cc
index f354422..81db2a2 100644
--- a/plugins/header_rewrite/parser.cc
+++ b/plugins/header_rewrite/parser.cc
@@ -54,7 +54,7 @@ Parser::preprocess(std::vector<std::string>& tokens)
       else
         _arg = "";
     } else {
-      TSError("header_rewrite: conditions must be embraced in %%{}");
+      TSLogError("Conditions must be embraced in %%{}");
       return;
     }
   } else {
@@ -87,7 +87,7 @@ Parser::preprocess(std::vector<std::string>& tokens)
         }
       } else {
         // Syntax error
-        TSError("header_rewrite: mods have to be embraced in []");
+        TSLogError("mods have to be embraced in []");
         return;
       }
     }
@@ -98,7 +98,7 @@ Parser::preprocess(std::vector<std::string>& tokens)
 Parser::Parser(const std::string& line) :
   _cond(false), _empty(false)
 {
-  TSDebug("header_rewrite_dbg", "Calling CTOR for Parser");
+  TSLogDebug("Calling CTOR for Parser");
 
   if (line[0] == '#') {
     _empty = true;


Mime
View raw message