1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-03 15:03:22 +02:00

libflashrom: Update the API for Logger Callback

The initial implementation does not account for user_data, requiring
the calling application to use a global scope. This may lead to issues
related to object lifecycle management and other architectural
concerns.

This patch adds user_data to the user’s log callback. Moreover, it
performs message formatting, so the application only needs to pass
the formatted string to the selected output.

The change does not break the existing logging API but extends it.
A new API version is introduced with the v2 suffix.

Testing: Both unit tests and CLI tools serve as libflashrom clients.
    All unit tests run successfully.

Change-Id: Iea738bd371fa3d69b9cf222c89ee67490d30af39
Signed-off-by: Dmitry Zhadinets <dzhadinets@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/86875
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Dmitry Zhadinets
2025-03-16 21:50:00 -04:00
committed by Anastasia Klimchuk
parent 90cc93d9bb
commit b1794138f0
10 changed files with 153 additions and 1 deletions

View File

@ -17,6 +17,7 @@ test_srcs = files(
'libusb_wraps.c',
'helpers.c',
'flashrom.c',
'libflashrom.c',
'spi25.c',
'lifecycle.c',
'layout.c',