Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
f4f3936d
Commit
f4f3936d
authored
8 years ago
by
zuul
Committed by
Gerrit Code Review
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge "pjproject: Increase SENDER_WIDTH column size for 64-bit system logs."
parents
26d1bd24
bf78c3c9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
third-party/pjproject/patches/0011-r5554-svn-backport-Increase-SENDER_WIDTH-column-size.patch
+77
-0
77 additions, 0 deletions
...5554-svn-backport-Increase-SENDER_WIDTH-column-size.patch
with
77 additions
and
0 deletions
third-party/pjproject/patches/0011-r5554-svn-backport-Increase-SENDER_WIDTH-column-size.patch
0 → 100644
+
77
−
0
View file @
f4f3936d
From df1ceb301c8a17969c467e3cf00246cfc28d1732 Mon Sep 17 00:00:00 2001
From: Richard Mudgett <rmudgett@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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment