Skip to content

HighlightConverter does not honor {STYLE_NAME} configuration #1545

Closed
@zartc

Description

@zartc

Description

When using the HighlightConverter like this: %highlight{%5level}{LOGBACK} the HighlightConverter always uses the colors of the DEFAULT preset instead of the color of the LOGBACK as asked.

Configuration

Version: 2.20.0

Operating system: Windows 10

JDK: temirun-11

Logs

none

Reproduction

Configure a converter with: %highlight{%5level}{LOGBACK}
You will discover that the HighlightConverter always uses the colors of the DEFAULT preset.

Fixe

HighlightConverter.createLevelStyleMap() method is missing a check at line 151 to see if the passed options[1] contains a map of LEVEL=color or a preset style name.

if (!string.contains("=")) {
    return STYLES.getOrDefault(string, DEFAULT_STYLES);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAdditions or updates to features

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions