From c35c2231cc2cf332704ad95d331e3806de0160bd Mon Sep 17 00:00:00 2001 From: Jaymz Julian Date: Mon, 7 Jul 2025 18:30:34 -0700 Subject: [PATCH] Change the LOG_SYSLOG_VIS parameters to include VIS_NOSLASH Change the LOG_SYSLOG_VIS parameters to include VIS_NOSLASH so that it's possible to log slashes through to event logs - this allows, amoungst other things, pass through of structured logging when built with that patch. Before: ``` debug3("logging a slash: \\ hi!")" ``` would output: ``` logging a slash: \\ hi! ``` instead of the correct: ``` logging a slash: \ hi! ``` This is important to us, since a logger we care about sends correctly escaped text through (specifically, the structured logging patch from hyperscale), causing serialisation issues. --- log.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/log.c b/log.c index 619334a1023..0fb906aba66 100644 --- a/log.c +++ b/log.c @@ -70,7 +70,10 @@ static size_t nlog_verbose; extern char *__progname; #ifdef WINDOWS -#define LOG_SYSLOG_VIS (VIS_CSTYLE|VIS_NL|VIS_TAB|VIS_OCTAL|VIS_LOG_UTF16) +/* We need NOSLASH on windows to avoid double escaping slashes when having them + * in logs on purpose, such as when using the slog patches from hyperscale + */ +#define LOG_SYSLOG_VIS (VIS_CSTYLE|VIS_NL|VIS_TAB|VIS_OCTAL|VIS_LOG_UTF16|VIS_NOSLASH) #else #define LOG_SYSLOG_VIS (VIS_CSTYLE|VIS_NL|VIS_TAB|VIS_OCTAL) #endif