On 11.01.21 09:02, [ext] Christian Storm wrote:
> From: Christian Storm <[email protected]>
> 
> Introduce ERROR(), WARNING(), and INFO() console message
> output macros to classify the messages and make their output
> more colorful so to increase readability for EBG's core output.
> 
> Signed-off-by: Christian Storm <[email protected]>
> ---
>  env/fatvars.c   | 44 ++++++++++++++++++++++----------------------
>  env/syspart.c   | 14 +++++++-------
>  include/utils.h | 20 +++++++++++++++++++-
>  main.c          | 14 ++++++--------
>  utils.c         | 49 ++++++++++++++++++++++++++++---------------------
>  5 files changed, 82 insertions(+), 59 deletions(-)
> 

...

> diff --git a/main.c b/main.c
> index 9fe8bbe..320e4dc 100644
> --- a/main.c
> +++ b/main.c
> @@ -114,9 +114,7 @@ EFI_STATUS efi_main(EFI_HANDLE image_handle, 
> EFI_SYSTEM_TABLE *system_table)
>       this_image = image_handle;
>       InitializeLib(this_image, system_table);
>  
> -     Color(system_table, 3, 0);
> -     Print(L"\nEFI Boot Guard %s\n", L""EFIBOOTGUARD_VERSION);
> -     Color(system_table, 7, 0);
> +     PrintC(EFI_CYAN, L"\nEFI Boot Guard %s\n", L"" EFIBOOTGUARD_VERSION);
>  
>       status =
>           uefi_call_wrapper(BS->OpenProtocol, 6, this_image,
> @@ -131,7 +129,7 @@ EFI_STATUS efi_main(EFI_HANDLE image_handle, 
> EFI_SYSTEM_TABLE *system_table)
>       tmp = DevicePathToStr(DevicePathFromHandle(loaded_image->DeviceHandle));
>       boot_medium_path = GetBootMediumPath(tmp);
>       mfree(tmp);
> -     Print(L"Boot medium: %s\n", boot_medium_path);
> +     INFO(L"Boot medium: %s\n", boot_medium_path);
>  
>       status = get_volumes(&volumes, &volume_count);
>       if (EFI_ERROR(status)) {
> @@ -139,7 +137,7 @@ EFI_STATUS efi_main(EFI_HANDLE image_handle, 
> EFI_SYSTEM_TABLE *system_table)
>                          status);
>       }
>  
> -     Print(L"Loading configuration...\n");
> +     INFO(L"Loading configuration...\n");
>  
>       bg_status = load_config(&bg_loader_params);
>       if (BG_ERROR(bg_status)) {
> @@ -151,7 +149,7 @@ EFI_STATUS efi_main(EFI_HANDLE image_handle, 
> EFI_SYSTEM_TABLE *system_table)
>                           EFI_ABORTED);
>                       break;
>               case BG_CONFIG_PARTIALLY_CORRUPTED:
> -                     Print(L"Config is partially corrupted. Please check.\n"
> +                     WARNING(L"Config is partially corrupted. Please 
> check.\n"
>                             L"efibootguard will try to boot.\n");
>                       break;
>               default:
> @@ -170,7 +168,7 @@ EFI_STATUS efi_main(EFI_HANDLE image_handle, 
> EFI_SYSTEM_TABLE *system_table)
>       }
>  
>       if (bg_loader_params.timeout == 0) {
> -             Print(L"Watchdog is disabled.\n");
> +             WARNING(L"Watchdog is disabled.\n");
>       } else {
>               status = scan_devices(loaded_image, bg_loader_params.timeout);
>               if (EFI_ERROR(status)) {
> @@ -202,7 +200,7 @@ EFI_STATUS efi_main(EFI_HANDLE image_handle, 
> EFI_SYSTEM_TABLE *system_table)
>       loaded_image->LoadOptionsSize =
>           (StrLen(bg_loader_params.payload_options) + 1) * sizeof(CHAR16);
>  
> -     Print(L"Starting %s with watchdog set to %d seconds\n",
> +     INFO(L"Starting %s with watchdog set to %d seconds ...",

Lost a newline here. Fixing up while dropping that INFO tag.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/2845699b-40d1-9105-6da9-181f6227179e%40siemens.com.

Reply via email to