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/include/utils.h b/include/utils.h
> index 8ce5ac6..72a7cbb 100644
> --- a/include/utils.h
> +++ b/include/utils.h
> @@ -40,6 +40,24 @@ EFI_DEVICE_PATH *FileDevicePathFromConfig(EFI_HANDLE 
> device,
>                                         CHAR16 *payloadpath);
>  CHAR16 *GetBootMediumPath(CHAR16 *input);
>  BOOLEAN IsOnBootMedium(EFI_DEVICE_PATH *dp);
> -VOID Color(EFI_SYSTEM_TABLE *system_table, char fgcolor, char bgcolor);
> +
> +VOID PrintC(const UINT8 color, const CHAR16 *fmt, ...);
> +#define ERROR(fmt, ...)                                                      
>   \
> +     do {                                                                   \
> +             PrintC(EFI_LIGHTRED, L"ERROR: ");                              \
> +             PrintC(EFI_LIGHTGRAY, fmt, ##__VA_ARGS__);                     \
> +     } while (0)
> +
> +#define WARNING(fmt, ...)                                                    
>   \
> +     do {                                                                   \
> +             PrintC(EFI_YELLOW, L"WARNING: ");                              \
> +             PrintC(EFI_LIGHTGRAY, fmt, ##__VA_ARGS__);                     \
> +     } while (0)
> +
> +#define INFO(fmt, ...)                                                       
>   \
> +     do {                                                                   \
> +             PrintC(EFI_WHITE, L"> ");                                      \

Only realized why trying out: What's the reason for the "> " prefix?

Jan

> +             PrintC(EFI_LIGHTGRAY, fmt, ##__VA_ARGS__);                     \
> +     } while (0)
>  
>  #endif // __H_UTILS__

-- 
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/a340f945-6ef8-00c6-dc0b-5163f1fe8bf0%40siemens.com.

Reply via email to