From 79f0d814c21db779ecc85ff7f7c77f9fe411eead Mon Sep 17 00:00:00 2001 From: Anastasia Klimchuk Date: Fri, 4 Apr 2025 23:08:50 +1100 Subject: [PATCH] cli: Set maximum log level for log callback Follow up (or fix) on commit 6571f263b52710579f27b3c53ade52d46acbc8e3 which adds ability to set maximum log level to log callback API. And INFO as the default. Without this patch cli options -V, -VV, -VVV not working anymore. cli at the moment processes all the messages in the callback, so log level should be maximum possible to get all the messages. Alternative to this could be setting the default max log level for callback as SPEW. Tested by running with -V, -VV, -VVV flashrom -p dummy:emulate=W25Q128FV,freq=64mhz -r dump.rom --progress Change-Id: I70a02ea1a1d692267fd6d92cdb5273786a913777 Signed-off-by: Anastasia Klimchuk Reviewed-on: https://review.coreboot.org/c/flashrom/+/87174 Tested-by: build bot (Jenkins) Reviewed-by: Dmitry Zhadinets Reviewed-by: Stefan Reinauer --- cli_classic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cli_classic.c b/cli_classic.c index d0c7114f0..3e5dab9f5 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -1110,6 +1110,9 @@ int main(int argc, char *argv[]) * chip when a flash device gets opened with fd 1 or 2. */ if (check_file(stdout) && check_file(stderr)) { + /* This is maximum log level for callback to be invoked, + * and cli wants callback to be always invoked. */ + flashrom_set_log_level(FLASHROM_MSG_SPEW); flashrom_set_log_callback(&flashrom_print_cb); }