Index: pjproject/trunk/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c	(revision 5982)
@@ -686,6 +686,6 @@
 		status = PixelFormat_to_pjmedia_format_id(*p, &fmt_id);
 		if (status != PJ_SUCCESS) {
-		    PJ_LOG(6, (THIS_FILE, "Unrecognized ffmpeg pixel "
-			       "format %d", *p));
+		    PJ_PERROR(6, (THIS_FILE, status,
+				  "Unrecognized ffmpeg pixel format %d", *p));
 		    continue;
 		}
Index: pjproject/trunk/pjmedia/src/pjmedia-codec/h264_packetizer.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia-codec/h264_packetizer.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia-codec/h264_packetizer.c	(revision 5982)
@@ -172,5 +172,5 @@
     {
 	//pj_assert(!"MTU too small for H.264 single NAL packetization mode");
-	PJ_LOG(2,("h264_packetizer.c",
+	PJ_LOG(2,(THIS_FILE,
 		  "MTU too small for H.264 (required=%u, MTU=%u)",
 		  nal_end - nal_start, pktz->cfg.mtu));
Index: pjproject/trunk/pjmedia/src/pjmedia-videodev/sdl_dev.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia-videodev/sdl_dev.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia-videodev/sdl_dev.c	(revision 5982)
@@ -372,6 +372,8 @@
 	    case PJMEDIA_EVENT_WND_RESIZED:
                 status = resize_disp(strm, &pevent.data.wnd_resized.new_size);
-                if (status != PJ_SUCCESS)
-                    PJ_LOG(3, (THIS_FILE, "Failed resizing the display."));
+		if (status != PJ_SUCCESS) {
+                    PJ_PERROR(3, (THIS_FILE, status,
+				  "Failed resizing the display."));
+		}
 		break;
 	    case PJMEDIA_EVENT_WND_CLOSING:
@@ -1182,7 +1184,7 @@
 
 	status = sdl_create_window(strm, PJ_TRUE, sdl_info->sdl_format, hwnd);
-        PJ_LOG(4, (THIS_FILE, "Re-initializing SDL with native window"
-        		      " %d: %s", hwnd->info.window,
-                              (status == PJ_SUCCESS? "success": "failed")));
+        PJ_PERROR(4, (THIS_FILE, status,
+		      "Re-initializing SDL with native window %d",
+		      hwnd->info.window));
 	return status;	
     }
@@ -1301,5 +1303,6 @@
                                    &jq->sem);
             if (status != PJ_SUCCESS) {
-                PJ_LOG(3, (THIS_FILE, "Failed growing SDL job queue size."));
+                PJ_PERROR(3, (THIS_FILE, status,
+			      "Failed growing SDL job queue size."));
                 return 0;
             }
@@ -1312,6 +1315,6 @@
                                        &jq->job_sem[i]);
                 if (status != PJ_SUCCESS) {
-                    PJ_LOG(3, (THIS_FILE, "Failed growing SDL job "
-                                          "queue size."));
+                    PJ_PERROR(3, (THIS_FILE, status,
+				  "Failed growing SDL job queue size."));
                     return 0;
                 }
Index: pjproject/trunk/pjmedia/src/pjmedia/delaybuf.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/delaybuf.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia/delaybuf.c	(revision 5982)
@@ -358,6 +358,5 @@
 	    /* Give all what delay buffer has, then pad with zeroes */
             if (b->wsola)
-	        PJ_LOG(4,(b->obj_name,"Error generating frame, status=%d", 
-		          status));
+	        PJ_PERROR(4,(b->obj_name, status, "Error generating frame"));
 
 	    pjmedia_circ_buf_read(b->circ_buf, frame, buf_len);
Index: pjproject/trunk/pjmedia/src/pjmedia/echo_common.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/echo_common.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia/echo_common.c	(revision 5982)
@@ -402,6 +402,6 @@
     if (rc != PJ_SUCCESS) {
 	/* Ooops.. no frame! */
-	PJ_LOG(5,(echo->obj_name, 
-		  "No frame from delay buffer. This will upset EC later"));
+	PJ_PERROR(5,(echo->obj_name, rc,
+		  "No frame from delay buffer (this will upset EC later)"));
 	pjmedia_zero_samples(oldest_frm->buf, echo->samples_per_frame);
     }
Index: pjproject/trunk/pjmedia/src/pjmedia/sdp.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/sdp.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia/sdp.c	(revision 5982)
@@ -1434,10 +1434,7 @@
     PJ_CATCH_ANY {
 	
-	char errmsg[PJ_ERR_MSG_SIZE];
-	pj_strerror(ctx.last_error, errmsg, sizeof(errmsg));
-
-	PJ_LOG(4, (THIS_FILE, "Error parsing SDP in line %d col %d: %s",
-		   scanner.line, pj_scan_get_col(&scanner),
-		   errmsg));
+	PJ_PERROR(4, (THIS_FILE, ctx.last_error,
+		      "Error parsing SDP in line %d col %d",
+		      scanner.line, pj_scan_get_col(&scanner)));
 
 	session = NULL;
Index: pjproject/trunk/pjmedia/src/pjmedia/stream.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia/stream.c	(revision 5982)
@@ -39,5 +39,5 @@
 #define THIS_FILE			"stream.c"
 #define ERRLEVEL			1
-#define LOGERR_(expr)			stream_perror expr
+#define LOGERR_(expr)			PJ_PERROR(4,expr);
 #define TRC_(expr)			PJ_LOG(5,expr)
 
@@ -269,15 +269,4 @@
 static pj_int16_t zero_frame[2 * 30 * 16000 / 1000];
 
-/*
- * Print error.
- */
-static void stream_perror(const char *sender, const char *title,
-			  pj_status_t status)
-{
-    char errmsg[PJ_ERR_MSG_SIZE];
-
-    pj_strerror(status, errmsg, sizeof(errmsg));
-    PJ_LOG(4,(sender, "%s: %s [err:%d]", title, errmsg, status));
-}
 
 static void on_rx_rtcp( void *data,
@@ -749,6 +738,6 @@
 					   &frame_out);
 	    if (status != 0) {
-		LOGERR_((port->info.name.ptr, "codec decode() error",
-			 status));
+		LOGERR_((port->info.name.ptr, status,
+			 "codec decode() error"));
 
 		if (use_dec_buf) {
@@ -862,6 +851,6 @@
 					   0, frame);
 	    if (status != PJ_SUCCESS) {
-		LOGERR_((port->info.name.ptr, "codec decode() error",
-			 status));
+		LOGERR_((port->info.name.ptr, status,
+			 "codec decode() error"));
 		pjmedia_frame_ext_append_subframe(f, NULL, 0,
 					    (pj_uint16_t)samples_per_frame);
@@ -1397,6 +1386,6 @@
 				       &frame_out);
 	if (status != PJ_SUCCESS) {
-	    LOGERR_((stream->port.info.name.ptr,
-		    "Codec encode() error", status));
+	    LOGERR_((stream->port.info.name.ptr, status,
+		    "Codec encode() error"));
 	    return status;
 	}
@@ -1421,6 +1410,6 @@
 				       &frame_out);
 	if (status != PJ_SUCCESS) {
-	    LOGERR_((stream->port.info.name.ptr,
-		    "Codec encode() error", status));
+	    LOGERR_((stream->port.info.name.ptr, status,
+		    "Codec encode() error"));
 	    return status;
 	}
@@ -1445,6 +1434,6 @@
 
     if (status != PJ_SUCCESS) {
-	LOGERR_((stream->port.info.name.ptr,
-		"RTP encode_rtp() error", status));
+	LOGERR_((stream->port.info.name.ptr, status,
+		"RTP encode_rtp() error"));
 	return status;
     }
@@ -1776,5 +1765,5 @@
 				    &hdr, &payload, &payloadlen);
     if (status != PJ_SUCCESS) {
-	LOGERR_((stream->port.info.name.ptr, "RTP decode error", status));
+	LOGERR_((stream->port.info.name.ptr, status, "RTP decode error"));
 	stream->rtcp.stat.rx.discard++;
 	return;
@@ -1931,7 +1920,6 @@
 				     payloadlen, &ts, &count, frames);
 	if (status != PJ_SUCCESS) {
-	    LOGERR_((stream->port.info.name.ptr,
-		     "Codec parse() error",
-		     status));
+	    LOGERR_((stream->port.info.name.ptr, status,
+		     "Codec parse() error"));
 	    count = 0;
 	} else if (stream->detect_ptime_change &&
@@ -2059,6 +2047,6 @@
 
     if (status != 0) {
-	LOGERR_((stream->port.info.name.ptr, "Jitter buffer put() error",
-		status));
+	LOGERR_((stream->port.info.name.ptr, status,
+		 "Jitter buffer put() error"));
 	pkt_discarded = PJ_TRUE;
 	goto on_return;
@@ -2122,6 +2110,6 @@
     if (bytes_read < 0) {
 	if (bytes_read != -PJ_STATUS_FROM_OS(OSERR_EWOULDBLOCK)) {
-	    LOGERR_((stream->port.info.name.ptr, "RTCP recv() error",
-		    (pj_status_t)-bytes_read));
+	    LOGERR_((stream->port.info.name.ptr, (pj_status_t)-bytes_read,
+		     "RTCP recv() error"));
 	}
 	return;
@@ -2779,9 +2767,10 @@
 			 TRACE_JB_PATH_PREFIX "%s.csv",
 			 stream->port.info.name.ptr);
-	status = pj_file_open(pool, trace_name, PJ_O_WRONLY, &stream->trace_jb_fd);
+	status = pj_file_open(pool, trace_name, PJ_O_WRONLY,
+			      &stream->trace_jb_fd);
 	if (status != PJ_SUCCESS) {
 	    stream->trace_jb_fd = TRACE_JB_INVALID_FD;
-	    PJ_LOG(3,(THIS_FILE, "Failed creating RTP trace file '%s'",
-		      trace_name));
+	    PJ_PERROR(3,(THIS_FILE, status,
+			 "Failed creating RTP trace file '%s'", trace_name));
 	} else {
 	    stream->trace_jb_buf = (char*)pj_pool_alloc(pool, PJ_LOG_MAX_SIZE);
Index: pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c	(revision 5982)
@@ -395,8 +395,6 @@
 {
     if (err != PJ_SUCCESS) {
-	char errmsg[PJ_ERR_MSG_SIZE];
-	pj_strerror(err, errmsg, sizeof(errmsg));
-	PJ_LOG(4,(tp_ice->base.name, 
-		  "Stopping ICE, reason=%s:%s", reason, errmsg));
+	PJ_PERROR(4,(tp_ice->base.name, err,
+		     "Stopping ICE, reason=%s", reason));
     } else {
 	PJ_LOG(4,(tp_ice->base.name, 
@@ -1061,9 +1059,9 @@
 			    &rem_m->attr[i]->value, &cand);
 	if (status != PJ_SUCCESS) {
-	    PJ_LOG(4,(tp_ice->base.name, 
-		      "Error in parsing SDP candidate attribute '%.*s', "
-		      "candidate is ignored",
-		      (int)rem_m->attr[i]->value.slen, 
-		      rem_m->attr[i]->value.ptr));
+	    PJ_PERROR(4,(tp_ice->base.name, status,
+			 "Error in parsing SDP candidate attribute '%.*s', "
+			 "candidate is ignored",
+			 (int)rem_m->attr[i]->value.slen, 
+			 rem_m->attr[i]->value.ptr));
 	    continue;
 	}
@@ -1491,8 +1489,8 @@
 			    &cand[cand_cnt]);
 	if (status != PJ_SUCCESS) {
-	    PJ_LOG(4,(tp_ice->base.name, 
-		      "Error in parsing SDP candidate attribute '%.*s', "
-		      "candidate is ignored",
-		      (int)attr->value.slen, attr->value.ptr));
+	    PJ_PERROR(4,(tp_ice->base.name, status,
+			 "Error in parsing SDP candidate attribute '%.*s', "
+			 "candidate is ignored",
+			 (int)attr->value.slen, attr->value.ptr));
 	    continue;
 	}
@@ -1671,7 +1669,6 @@
 					    &pwd_attr->value);
 	    if (status != PJ_SUCCESS) {
-		PJ_LOG(1,(tp_ice->base.name, 
-			  "ICE re-initialization failed (status=%d)!",
-			  status));
+		PJ_PERROR(1,(tp_ice->base.name, status,
+			     "ICE re-initialization failed!"));
 		return status;
 	    }
@@ -1711,7 +1708,5 @@
     status = start_ice(tp_ice, tmp_pool, rem_sdp, media_index);
     if (status != PJ_SUCCESS) {
-	PJ_LOG(1,(tp_ice->base.name, 
-		  "ICE restart failed (status=%d)!",
-		  status));
+	PJ_PERROR(1,(tp_ice->base.name, status, "ICE restart failed!"));
 	return status;
     }
Index: pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c	(revision 5982)
@@ -515,6 +515,6 @@
 #endif
 
-    if (pjmedia_endpt_atexit(endpt, pjmedia_srtp_deinit_lib) != PJ_SUCCESS)
-    {
+    status = pjmedia_endpt_atexit(endpt, pjmedia_srtp_deinit_lib);
+    if (status != PJ_SUCCESS) {
 	/* There will be memory leak when it fails to schedule libsrtp
 	 * deinitialization, however the memory leak could be harmless,
@@ -522,5 +522,9 @@
 	 * when the application terminates.
 	 */
-	PJ_LOG(4, (THIS_FILE, "Failed to register libsrtp deinit."));
+	PJ_PERROR(4, (THIS_FILE, status,
+		      "Failed to register libsrtp deinit."));
+
+	/* Ignore this error */
+	status = PJ_SUCCESS;
     }
 
@@ -1758,6 +1762,6 @@
     status = pjmedia_transport_media_stop(srtp->member_tp);
     if (status != PJ_SUCCESS)
-	PJ_LOG(4, (srtp->pool->obj_name,
-		   "SRTP failed stop underlying media transport."));
+	PJ_PERROR(4, (srtp->pool->obj_name, status,
+		      "SRTP failed stop underlying media transport."));
 
     /* Finally, stop SRTP */
Index: pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_sdes.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_sdes.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_sdes.c	(revision 5982)
@@ -129,5 +129,6 @@
 				 crypto_suites[cs_idx].cipher_key_len);
 	    if (err != 1) {
-		PJ_LOG(5,(THIS_FILE, "Failed generating random key"));
+		PJ_LOG(4,(THIS_FILE, "Failed generating random key "
+			  "(native err=%d)", err));
 		return PJMEDIA_ERRNO_FROM_LIBSRTP(1);
 	    }
@@ -160,8 +161,10 @@
 
     /* Key transmitted via SDP should be base64 encoded. */
-    status = pj_base64_encode((pj_uint8_t*)crypto->key.ptr, (int)crypto->key.slen,
+    status = pj_base64_encode((pj_uint8_t*)crypto->key.ptr,
+			      (int)crypto->key.slen,
 			      b64_key, &b64_key_len);
     if (status != PJ_SUCCESS) {
-	PJ_LOG(5,(THIS_FILE, "Failed encoding plain key to base64"));
+	PJ_PERROR(4,(THIS_FILE, status,
+		     "Failed encoding plain key to base64"));
 	return status;
     }
@@ -259,5 +262,6 @@
 			      &itmp);
     if (status != PJ_SUCCESS) {
-	PJ_LOG(4,(THIS_FILE, "Failed decoding crypto key from base64"));
+	PJ_PERROR(4,(THIS_FILE, status,
+		     "Failed decoding crypto key from base64"));
 	return status;
     }
Index: pjproject/trunk/pjmedia/src/pjmedia/vid_port.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/vid_port.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia/vid_port.c	(revision 5982)
@@ -1001,9 +1001,9 @@
         {
             status = pjmedia_vid_dev_stream_set_cap(vp->strm,
-                                                    PJMEDIA_VID_DEV_CAP_FORMAT,
-                                                    &vp->conv.conv_param.dst);
+                                                PJMEDIA_VID_DEV_CAP_FORMAT,
+                                                &vp->conv.conv_param.dst);
             if (status != PJ_SUCCESS) {
-                PJ_LOG(3, (THIS_FILE, "failure in changing the format of the "
-                                      "video device"));
+                PJ_PERROR(3,(THIS_FILE, status,
+		    "failure in changing the format of the video device"));
                 PJ_LOG(3, (THIS_FILE, "reverting to its original format: %s",
                                       status != PJMEDIA_EVID_ERR ? "success" :
Index: pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c	(revision 5982)
@@ -41,5 +41,5 @@
 #define THIS_FILE			"vid_stream.c"
 #define ERRLEVEL			1
-#define LOGERR_(expr)			stream_perror expr
+#define LOGERR_(expr)			PJ_PERROR(4,expr)
 #define TRC_(expr)			PJ_LOG(5,expr)
 #define SIGNATURE			PJMEDIA_SIG_PORT_VID_STREAM
@@ -196,16 +196,4 @@
 static pj_status_t decode_frame(pjmedia_vid_stream *stream,
                                 pjmedia_frame *frame);
-
-/*
- * Print error.
- */
-static void stream_perror(const char *sender, const char *title,
-			  pj_status_t status)
-{
-    char errmsg[PJ_ERR_MSG_SIZE];
-
-    pj_strerror(status, errmsg, sizeof(errmsg));
-    PJ_LOG(4,(sender, "%s: %s [err:%d]", title, errmsg, status));
-}
 
 
@@ -645,5 +633,5 @@
 				    &hdr, &payload, &payloadlen);
     if (status != PJ_SUCCESS) {
-	LOGERR_((channel->port.info.name.ptr, "RTP decode error", status));
+	LOGERR_((channel->port.info.name.ptr, status, "RTP decode error"));
 	stream->rtcp.stat.rx.discard++;
 	return;
@@ -826,6 +814,6 @@
 
     if (status != 0) {
-	LOGERR_((channel->port.info.name.ptr, "Jitter buffer put() error", 
-		status));
+	LOGERR_((channel->port.info.name.ptr, status,
+		 "Jitter buffer put() error"));
 	pkt_discarded = PJ_TRUE;
 	goto on_return;
@@ -867,6 +855,6 @@
     if (bytes_read < 0) {
 	if (bytes_read != -PJ_STATUS_FROM_OS(OSERR_EWOULDBLOCK)) {
-	    LOGERR_((stream->cname.ptr, "RTCP recv() error",
-		    (pj_status_t)-bytes_read));
+	    LOGERR_((stream->cname.ptr, (pj_status_t)-bytes_read,
+		     "RTCP recv() error"));
 	}
 	return;
@@ -968,6 +956,6 @@
                                             &has_more_data);
     if (status != PJ_SUCCESS) {
-	LOGERR_((channel->port.info.name.ptr,
-		"Codec encode_begin() error", status));
+	LOGERR_((channel->port.info.name.ptr, status,
+		"Codec encode_begin() error"));
 
 	/* Update RTP timestamp */
@@ -997,6 +985,6 @@
 	                                &rtphdrlen);
 	if (status != PJ_SUCCESS) {
-	    LOGERR_((channel->port.info.name.ptr,
-		    "RTP encode_rtp() error", status));
+	    LOGERR_((channel->port.info.name.ptr, status,
+		    "RTP encode_rtp() error"));
 	    return status;
 	}
@@ -1017,7 +1005,6 @@
 		enum { COUNT_TO_REPORT = 20 };
 		if (stream->send_err_cnt++ == 0) {
-		    LOGERR_((channel->port.info.name.ptr,
-			     "Transport send_rtp() error",
-			     status));
+		    LOGERR_((channel->port.info.name.ptr, status,
+			     "Transport send_rtp() error"));
 		}
 		if (stream->send_err_cnt > COUNT_TO_REPORT)
@@ -1046,6 +1033,6 @@
 					       &has_more_data);
 	if (status != PJ_SUCCESS) {
-	    LOGERR_((channel->port.info.name.ptr,
-		     "Codec encode_more() error", status));
+	    LOGERR_((channel->port.info.name.ptr, status,
+		     "Codec encode_more() error"));
 	    /* Ignore this error (?) */
 	    break;
@@ -1235,6 +1222,6 @@
 	                                  (unsigned)frame->size, frame);
 	if (status != PJ_SUCCESS) {
-	    LOGERR_((channel->port.info.name.ptr, "codec decode() error",
-		     status));
+	    LOGERR_((channel->port.info.name.ptr, status,
+		     "codec decode() error"));
 	    frame->type = PJMEDIA_FRAME_TYPE_NONE;
 	    frame->size = 0;
@@ -1844,6 +1831,7 @@
 	if (status != PJ_SUCCESS) {
 	    stream->trace_jb_fd = TRACE_JB_INVALID_FD;
-	    PJ_LOG(3,(THIS_FILE, "Failed creating RTP trace file '%s'", 
-		      trace_name));
+	    PJ_PERROR(3,(THIS_FILE, status,
+			 "Failed creating RTP trace file '%s'", 
+			 trace_name));
 	} else {
 	    stream->trace_jb_buf = (char*)pj_pool_alloc(pool, PJ_LOG_MAX_SIZE);
Index: pjproject/trunk/pjmedia/src/pjmedia/vid_tee.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/vid_tee.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia/vid_tee.c	(revision 5982)
@@ -318,9 +318,9 @@
                                                frame, &frame_);
             if (status != PJ_SUCCESS) {
-                PJ_LOG(3, (THIS_FILE,
-			       "Failed to convert frame for destination"
-                               " port %d (%.*s)", i,
-                               tee->dst_ports[i].dst->info.name.slen,
-                               tee->dst_ports[i].dst->info.name.ptr));
+                PJ_PERROR(3, (THIS_FILE, status,
+			      "Failed to convert frame for destination"
+			      " port %d (%.*s)", i,
+			      tee->dst_ports[i].dst->info.name.slen,
+			      tee->dst_ports[i].dst->info.name.ptr));
                 continue;
             }
Index: pjproject/trunk/pjmedia/src/pjmedia/wsola.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/wsola.c	(revision 5981)
+++ pjproject/trunk/pjmedia/src/pjmedia/wsola.c	(revision 5982)
@@ -528,5 +528,5 @@
     status = pjmedia_circ_buf_create(pool, wsola->buf_size, &wsola->buf);
     if (status != PJ_SUCCESS) {
-	PJ_LOG(3, (THIS_FILE, "Failed to create circular buf"));
+	PJ_PERROR(3, (THIS_FILE, status, "Failed to create circular buf"));
 	return status;
     }
