Description
After upgrading to version >= 2.25.0, when rendering ansi, italic styling on log message no longer works (triggers a warning that the style italic is invalid) while underline styling on log message produces italic effect on rendered text. The warning message includes a stack trace that points to AnsiEscape.createSequence failing to create sequence for style name italic at the line below in JAnsiTextRenderer.
|
merge(AnsiEscape.createSequence(styleName), output, first); |
This seems to boil down to #3070, which rewrites JAnsiTextRenderer to use AnsiEscape instead of depending on external Jansi library to generate ansi escape sequences. However, the enum AnsiEscape differs from the enums in the old external Jansi library in that:
AnsiEscape does not have the ITALIC entry.
AnsiEscape.UNDERLINE has the code value of 3 which correspond to ITALIC.
- Code value
4 which corresponds to underline style seems to not be assigned to any enum value in AnsiEscape.
(Style code referenced from https://en.wikipedia.org/wiki/ANSI_escape_code#Select_Graphic_Rendition_parameters)
I'm wondering if this was a bug that existed in AnsiEscape from a long time ago that was just never noticed. The enum values from this file seems to have been unchanged for a long time. Thank you for your assistant with this issue.
Configuration
Version: >= 2.25.0
Operating system: Windows 11
JDK: 17.0.16
Logs
// to be supplied
[Stacktraces, errors, etc. relevant applications logs.]
Reproduction
Will supplement this at a later time.
[An isolated test reproducing the test.
JUnit tests similar to the ones in the code base are extremely appreciated.]
Description
After upgrading to version >= 2.25.0, when rendering ansi,
italicstyling on log message no longer works (triggers a warning that the style italic is invalid) whileunderlinestyling on log message produces italic effect on rendered text. The warning message includes a stack trace that points toAnsiEscape.createSequencefailing to create sequence for style nameitalicat the line below inJAnsiTextRenderer.logging-log4j2/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiTextRenderer.java
Line 251 in 76c8bef
This seems to boil down to #3070, which rewrites
JAnsiTextRendererto useAnsiEscapeinstead of depending on external Jansi library to generate ansi escape sequences. However, the enumAnsiEscapediffers from the enums in the old external Jansi library in that:AnsiEscapedoes not have theITALICentry.AnsiEscape.UNDERLINEhas the code value of3which correspond toITALIC.4which corresponds tounderlinestyle seems to not be assigned to any enum value inAnsiEscape.(Style code referenced from https://en.wikipedia.org/wiki/ANSI_escape_code#Select_Graphic_Rendition_parameters)
I'm wondering if this was a bug that existed in
AnsiEscapefrom a long time ago that was just never noticed. The enum values from this file seems to have been unchanged for a long time. Thank you for your assistant with this issue.Configuration
Version: >= 2.25.0
Operating system: Windows 11
JDK: 17.0.16
Logs
Reproduction
Will supplement this at a later time.
[An isolated test reproducing the test.
JUnit tests similar to the ones in the code base are extremely appreciated.]