/** * Creates a Map from a source array where values are ANSI escape sequences. The format is: * * <pre> * Key1=Value, Key2=Value, ... * </pre> * * For example: * * <pre> * ERROR=red bold, WARN=yellow bold, INFO=green, ... * </pre> * * You can use whitespace around the comma and equal sign. The names in values MUST come from the * {@linkplain AnsiEscape} enum, case is normalized to upper-case internally. * * @param values the source string to parse. * @param dontEscapeKeys do not escape these keys, leave the values as is in the map * @return a new map */ public static Map<String, String> createMap(final String values, final String[] dontEscapeKeys) { return createMap(values.split(Patterns.COMMA_SEPARATOR), dontEscapeKeys); }
.replaceAll(PatternParser.NO_CONSOLE_NO_ANSI + "=(true|false)", Strings.EMPTY); final Map<String, String> styles = AnsiEscape.createMap(string, new String[] {STYLE_KEY}); final Map<Level, String> levelStyles = new HashMap<>(DEFAULT_STYLES); for (final Map.Entry<String, String> entry : styles.entrySet()) {