Change in libosmocore[master]: logging: Introduce MAX_LOG_SIZE for the magic number 4096

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Sep 27 15:38:09 UTC 2020


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/20304 )


Change subject: logging: Introduce MAX_LOG_SIZE for the magic number 4096
......................................................................

logging: Introduce MAX_LOG_SIZE for the magic number 4096

Change-Id: Ia9645098dffecd29242857de8f1aea6b9aca5918
---
M src/logging.c
1 file changed, 4 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/04/20304/1

diff --git a/src/logging.c b/src/logging.c
index 8f8c33d..704107b 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -56,6 +56,9 @@
 
 #include <osmocom/vty/logging.h>	/* for LOGGING_STR. */
 
+/* maximum length of the log string of a single log event (typically  line) */
+#define MAX_LOG_SIZE	4096
+
 osmo_static_assert(_LOG_CTX_COUNT <= ARRAY_SIZE(((struct log_context*)NULL)->ctx),
 		   enum_logging_ctx_items_fit_in_struct_log_context);
 osmo_static_assert(_LOG_FLT_COUNT <= ARRAY_SIZE(((struct log_target*)NULL)->filter_data),
@@ -390,7 +393,7 @@
 		    unsigned int level, const char *file, int line, int cont,
 		    const char *format, va_list ap)
 {
-	char buf[4096];
+	char buf[MAX_LOG_SIZE];
 	int ret, len = 0, offset = 0, rem = sizeof(buf);
 	const char *c_subsys = NULL;
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/20304
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia9645098dffecd29242857de8f1aea6b9aca5918
Gerrit-Change-Number: 20304
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200927/ce57a822/attachment.htm>


More information about the gerrit-log mailing list