Anastasia Klimchuk submitted this change.

View Change

Approvals: Stefan Reinauer: Looks good to me, approved build bot (Jenkins): Verified Dmitry Zhadinets: Looks good to me, but someone else must approve
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 <aklm@flashrom.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/87174
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Dmitry Zhadinets <dzhadinets@gmail.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
---
M cli_classic.c
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/cli_classic.c b/cli_classic.c
index d0c7114..3e5dab9 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -1110,6 +1110,9 @@
* 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);
}


To view, visit change 87174. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I70a02ea1a1d692267fd6d92cdb5273786a913777
Gerrit-Change-Number: 87174
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Dmitry Zhadinets <dzhadinets@gmail.com>
Gerrit-Reviewer: Peter Marheine <pmarheine@chromium.org>
Gerrit-Reviewer: Stefan Reinauer <stefan.reinauer@coreboot.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>