From 8b9edccbc6bcb803baeaec21b507ac4fcc0cb61c Mon Sep 17 00:00:00 2001 From: Vincent Barrilliot Date: Tue, 31 Jan 2023 21:59:22 +0100 Subject: [PATCH] Return default log level to something less verbose for normal use. --- src/log.c | 3 ++- src/log.h | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/log.c b/src/log.c index cdbea41..83b8850 100644 --- a/src/log.c +++ b/src/log.c @@ -28,6 +28,7 @@ static short log_channel = LOG_CHANNEL; static short log_level; +// do_log either points to log_to_uart or log_to_screen. static void (*do_log)(const char* message); static void log_to_uart(const char* message); static void log_to_screen(const char* message); @@ -270,7 +271,7 @@ void log(short level, const char * message, ...) { if (level > log_level) return; - char buf[80]; // Should hopefully be long enough ! MCP stack is only 1K + char buf[80]; // Should hopefully be long enough ! va_list args; va_start(args, message); diff --git a/src/log.h b/src/log.h index 2dbd42c..b4cfc21 100644 --- a/src/log.h +++ b/src/log.h @@ -16,7 +16,7 @@ * Settings */ #ifndef DEFAULT_LOG_LEVEL - #define DEFAULT_LOG_LEVEL LOG_TRACE + #define DEFAULT_LOG_LEVEL LOG_ERROR #endif #ifndef LOG_CHANNEL @@ -118,7 +118,7 @@ extern void log_c(short log_level, char c); # define ERROR4(a,b,c,d,e) log(LOG_ERROR, a, b, c, d, e) # define ERROR5(a,b,c,d,e,f) log(LOG_ERROR, a, b, c, d, e, f) #else -# define ERROR(m,...) +# define ERROR(m) # define ERROR1(a,b) # define ERROR2(a,b,c) # define ERROR3(a,b,c,d) @@ -135,7 +135,7 @@ extern void log_c(short log_level, char c); # define INFO4(a,b,c,d,e) log(LOG_INFO, a, b, c, d, e) # define INFO5(a,b,c,d,e,f) log(LOG_INFO, a, b, c, d, e, f) #else -# define INFO(m,...) +# define INFO(m) # define INFO1(a,b) # define INFO2(a,b,c) # define INFO3(a,b,c,d) @@ -151,7 +151,7 @@ extern void log_c(short log_level, char c); # define DEBUG4(a,b,c,d,e) log(LOG_DEBUG, a, b, c, d, e) # define DEBUG5(a,b,c,d,e,f) log(LOG_DEBUG, a, b, c, d, e, f) #else -# define DEBUG(m,...) +# define DEBUG(m) # define DEBUG1(a,b) # define DEBUG2(a,b,c) # define DEBUG3(a,b,c,d)