From 2ba224e1526681c1a0b1b2b095b1ef2b0874db48 Mon Sep 17 00:00:00 2001 From: bfredl Date: Sun, 26 Feb 2023 12:51:03 +0100 Subject: refactor(log): reduce compile time LOG_LEVEL granularity --- src/nvim/log.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/nvim/log.c') diff --git a/src/nvim/log.c b/src/nvim/log.c index 2c214aa32d..77eeb09fec 100644 --- a/src/nvim/log.c +++ b/src/nvim/log.c @@ -141,9 +141,13 @@ bool logmsg(int log_level, const char *context, const char *func_name, int line_ return false; } - if (log_level < MIN_LOG_LEVEL) { +#ifndef NVIM_LOG_DEBUG + // This should rarely happen (callsites are compiled out), but to be sure. + // TODO(bfredl): allow log levels to be configured at runtime + if (log_level < LOGLVL_WRN) { return false; } +#endif #ifdef EXITFREE // Logging after we've already started freeing all our memory will only cause -- cgit