From dbbf824f81fa55d6a25bfc5b127e09d05360c0ff Mon Sep 17 00:00:00 2001 From: "Mark A. Grondona" Date: Tue, 14 Jan 2025 08:43:51 -0800 Subject: [PATCH] libflux: hide internal log buffer size from public API Problem: libflux/flog.h exposes FLUX_MAX_LOGBUF via the public API, but there are currently no users. Furthermore, the implementation now falls back to a heap-allocated buffer if the internal fixed-size buffer causes log message truncation, so exposing the internal buffer size is misleading. Move the definition of FLUX_MAX_LOGBUF out of the public API. --- src/common/libflux/flog.c | 2 ++ src/common/libflux/flog.h | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common/libflux/flog.c b/src/common/libflux/flog.c index 2c968c796216..5d745262d85f 100644 --- a/src/common/libflux/flog.c +++ b/src/common/libflux/flog.c @@ -25,6 +25,8 @@ #include "src/common/libutil/wallclock.h" #include "src/common/libutil/stdlog.h" +#define FLUX_MAX_LOGBUF 2048 + typedef struct { char appname[STDLOG_MAX_APPNAME + 1]; char procid[STDLOG_MAX_PROCID + 1]; diff --git a/src/common/libflux/flog.h b/src/common/libflux/flog.h index 4399fb8ba2df..6d207e864b42 100644 --- a/src/common/libflux/flog.h +++ b/src/common/libflux/flog.h @@ -20,9 +20,6 @@ extern "C" { #endif - -#define FLUX_MAX_LOGBUF 2048 - typedef void (*flux_log_f)(const char *buf, int len, void *arg); /* Set log appname for handle instance.