1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-26 22:52:34 +02:00

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>
This commit is contained in:
Anastasia Klimchuk 2025-04-04 23:08:50 +11:00
parent 6571f263b5
commit 79f0d814c2

View File

@ -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);
}