[Asterisk-code-review] pjproject: Increase SENDER WIDTH column size for 64-bit syst... (asterisk[master])

Anonymous Coward asteriskteam at digium.com
Tue Feb 21 20:14:26 CST 2017


Anonymous Coward #1000019 has submitted this change and it was merged. ( https://gerrit.asterisk.org/5036 )

Change subject: pjproject: Increase SENDER_WIDTH column size for 64-bit system logs.
......................................................................


pjproject: Increase SENDER_WIDTH column size for 64-bit system logs.

ASTERISK-26669
ASTERISK-26738

Change-Id: Ibae6fc8cae69a1f04df0c577c4c11200499d6fe0
---
A third-party/pjproject/patches/0011-r5554-svn-backport-Increase-SENDER_WIDTH-column-size.patch
1 file changed, 77 insertions(+), 0 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Sean Bright: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/third-party/pjproject/patches/0011-r5554-svn-backport-Increase-SENDER_WIDTH-column-size.patch b/third-party/pjproject/patches/0011-r5554-svn-backport-Increase-SENDER_WIDTH-column-size.patch
new file mode 100644
index 0000000..4c53337
--- /dev/null
+++ b/third-party/pjproject/patches/0011-r5554-svn-backport-Increase-SENDER_WIDTH-column-size.patch
@@ -0,0 +1,77 @@
+From df1ceb301c8a17969c467e3cf00246cfc28d1732 Mon Sep 17 00:00:00 2001
+From: Richard Mudgett <rmudgett at digium.com>
+Date: Mon, 20 Feb 2017 12:19:05 -0600
+Subject: [PATCH 1/5] r5554 svn backport Increase SENDER_WIDTH column size for
+ 64-bit systems.
+
+Re #1994 (misc): Make the log's sender and thread width a compile-time configurable setting.
+
+Thanks to Richard Mudgett for the suggestion.
+---
+ pjlib/include/pj/config.h | 27 +++++++++++++++++++++++++++
+ pjlib/src/pj/log.c        |  4 ++--
+ 2 files changed, 29 insertions(+), 2 deletions(-)
+
+diff --git a/pjlib/include/pj/config.h b/pjlib/include/pj/config.h
+index 079d69b..3523f50 100644
+--- a/pjlib/include/pj/config.h
++++ b/pjlib/include/pj/config.h
+@@ -442,6 +442,33 @@
+ #endif
+ 
+ /**
++ * Log sender width.
++ *
++ * Default: 22 (for 64-bit machines), 14 otherwise
++ */
++#ifndef PJ_LOG_SENDER_WIDTH
++#   if PJ_HAS_STDINT_H
++#       include <stdint.h>
++#       if (UINTPTR_MAX == 0xffffffffffffffff)
++#           define PJ_LOG_SENDER_WIDTH  22
++#       else
++#           define PJ_LOG_SENDER_WIDTH  14
++#       endif
++#   else
++#       define PJ_LOG_SENDER_WIDTH  14
++#   endif
++#endif
++
++/**
++ * Log thread name width.
++ *
++ * Default: 12
++ */
++#ifndef PJ_LOG_THREAD_WIDTH
++#   define PJ_LOG_THREAD_WIDTH	    12
++#endif
++
++/**
+  * Colorfull terminal (for logging etc).
+  *
+  * Default: 1
+diff --git a/pjlib/src/pj/log.c b/pjlib/src/pj/log.c
+index 293ad46..cf7ac37 100644
+--- a/pjlib/src/pj/log.c
++++ b/pjlib/src/pj/log.c
+@@ -380,7 +380,7 @@ PJ_DEF(void) pj_log( const char *sender, int level,
+ 	pre += pj_utoa_pad(ptime.msec, pre, 3, '0');
+     }
+     if (log_decor & PJ_LOG_HAS_SENDER) {
+-	enum { SENDER_WIDTH = 14 };
++	enum { SENDER_WIDTH = PJ_LOG_SENDER_WIDTH };
+ 	pj_size_t sender_len = strlen(sender);
+ 	if (pre!=log_buffer) *pre++ = ' ';
+ 	if (sender_len <= SENDER_WIDTH) {
+@@ -395,7 +395,7 @@ PJ_DEF(void) pj_log( const char *sender, int level,
+ 	}
+     }
+     if (log_decor & PJ_LOG_HAS_THREAD_ID) {
+-	enum { THREAD_WIDTH = 12 };
++	enum { THREAD_WIDTH = PJ_LOG_THREAD_WIDTH };
+ 	const char *thread_name = pj_thread_get_name(pj_thread_this());
+ 	pj_size_t thread_len = strlen(thread_name);
+ 	*pre++ = ' ';
+-- 
+2.7.4
+

-- 
To view, visit https://gerrit.asterisk.org/5036
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibae6fc8cae69a1f04df0c577c4c11200499d6fe0
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>



More information about the asterisk-code-review mailing list