Re: [PATCH 05/25] console: Fix message colours

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Dec 13, 2021 at 10:08:45PM +0100, Sascha Hauer wrote:
> The correct code to change colours is "\033[1;31m", not "\033[31m". Fix
> that.

Uhmm I am curious why this is the "correct" way. From what I can tell
the terminfo for me says that 'setaf' red is '\e[31m'.
Maybe the EFI consol doesn't support setaf "termcap", an only has the
'sgr' capability, and the non-bold red selected as '\e[0;31m'.

cheers

> 
> Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
> ---
>  common/console_common.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/common/console_common.c b/common/console_common.c
> index 91a81e50fa..7bef74c543 100644
> --- a/common/console_common.c
> +++ b/common/console_common.c
> @@ -23,12 +23,12 @@
>  #ifndef CONFIG_CONSOLE_NONE
>  
>  static const char *colored_log_level[] = {
> -	[MSG_EMERG] = "\033[31mEMERG:\033[0m ",		/* red */
> -	[MSG_ALERT] = "\033[31mALERT:\033[0m ",		/* red */
> -	[MSG_CRIT] = "\033[31mCRITICAL:\033[0m ",	/* red */
> -	[MSG_ERR] = "\033[31mERROR:\033[0m ",		/* red */
> -	[MSG_WARNING] = "\033[33mWARNING:\033[0m ",	/* yellow */
> -	[MSG_NOTICE] = "\033[34mNOTICE:\033[0m ",	/* blue */
> +	[MSG_EMERG] = "\033[1;31mEMERG:\033[0m ",	/* red */
> +	[MSG_ALERT] = "\033[1;31mALERT:\033[0m ",	/* red */
> +	[MSG_CRIT] = "\033[1;31mCRITICAL:\033[0m ",	/* red */
> +	[MSG_ERR] = "\033[1;31mERROR:\033[0m ",		/* red */
> +	[MSG_WARNING] = "\033[1;33mWARNING:\033[0m ",	/* yellow */
> +	[MSG_NOTICE] = "\033[1;34mNOTICE:\033[0m ",	/* blue */
>  };
>  
>  int barebox_loglevel = CONFIG_DEFAULT_LOGLEVEL;
> -- 
> 2.30.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@xxxxxxxxxxxxxxxxxxx
> http://lists.infradead.org/mailman/listinfo/barebox
> 
> 
> To declare a filtering error, please use the following link : https://www.security-mail.net/reporter.php?mid=3e86.61b7b6f5.c4cd9.0&r=jmaselbas%40kalray.eu&s=barebox-bounces%2Bjmaselbas%3Dkalray.eu%40lists.infradead.org&o=%5BPATCH+05%2F25%5D+console%3A+Fix+message+colours&verdict=C&c=c280cd527bf219cdc889e73ba093616095b2dfa3
> 





_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux