[ 
https://issues.apache.org/jira/browse/LOG4J2-3537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17554469#comment-17554469
 ] 

Piotr Karwasz commented on LOG4J2-3537:
---------------------------------------

[~Pavel_K],

I agree that "bright blue" should be "bold blue", but we need to be concerned 
with backward compatibility: users that use "bright blue" or "blue bright" 
should not see any difference. So you can:
 # add a semantically correct {{BOLD("1")}} constant,
 # deprecate the {{BRIGHT}} constant and change its Javadoc to mark the fact 
that it changes the font weight, not color brightness/saturation,
 # correct the color table in the documentation to show the correct constants 
you should use.

I think that LOG4J2-3538 is independent from this issue: you can add 
{{BRIGHT_*}} (and {{FG_BRIGHT_*}} and {{{}BG_BRIGHT_*{}}}) constants to solve 
this issue and independently add support for {{{}#RRGGBB{}}}, {{FG_#RRGGBB}} 
and {{BG_#RRGGBB}} color specifications.

> Ansi escape code for highlight is generated wrong
> -------------------------------------------------
>
>                 Key: LOG4J2-3537
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3537
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.14.1
>            Reporter: Pavel_K
>            Assignee: Piotr Karwasz
>            Priority: Minor
>         Attachments: Screenshot from 2022-06-14 16-09-30.png, Screenshot from 
> 2022-06-14 16-13-13.png
>
>
> This is a test pattern layout:
> {code:java}
>  <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} 
> %highlight{[%level]}{FATAL=red bright, ERROR=red bright, WARN=yellow bright, 
> INFO=magenta bright, DEBUG=green, TRACE=blue bright} [%t] %logger{36} - 
> %msg%n" disableAnsi="false"/>
> {code}
> As you see for TRACE level is `blue bright`. However, this is a generated 
> code:
> [TRACE] . As you see we have 
> [SGR|https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters]
>  function with two parameters: 34 is color and 1 is bold. 
> For example linux terminal will render it this way:
>  !Screenshot from 2022-06-14 16-09-30.png! 
> We see, that it is not `bright blue` but `bold blue`. At the same time in 
> [manual|https://logging.apache.org/log4j/2.x/manual/layouts.html] they speak 
> about different colors:
>  !Screenshot from 2022-06-14 16-13-13.png! 
> And if we want bright blue, generated escape code should be `[TRACE]` 
> - see the link to SGR function I provided.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to