@@ -0,0 +1,2989 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements. See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache license, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License. You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the license for the specific language governing permissions and%0A * limitations under the license.%0A */%0Apackage org.apache.logging.log4j.core.appender;%0A%0Aimport static org.fusesource.jansi.Ansi.*;%0Aimport static org.fusesource.jansi.Ansi.Color.*;%0A%0Aimport org.apache.logging.log4j.LogManager;%0Aimport org.apache.logging.log4j.Logger;%0Aimport org.apache.logging.log4j.core.LoggerContext;%0Aimport org.apache.logging.log4j.core.config.Configurator;%0Aimport org.junit.Test;%0A%0A/**%0A * Shows how to use ANSI escape codes to color messages. Each message is printed to the console in color, but the rest%0A * of the log entry (time stamp for example) is in the default color for that console.%0A * %3Cp%3E%0A * Running from a Windows command line from the root of the project:%0A * %3C/p%3E%0A *%0A * %3Cpre%3E%0A * mvn -Dtest=org.apache.logging.log4j.core.appender.ConsoleAppenderJAnsiMessageMain test%0A * %3C/pre%3E%0A * %0A * or:%0A * %0A * %3Cpre%3E%0A * java -classpath log4j-core%5Ctarget%5Ctest-classes;log4j-core%5Ctarget%5Cclasses;log4j-api%5Ctarget%5Cclasses;%25HOME%25%5C.m2%5Crepository%5Corg%5Cfusesource%5Cjansi%5Cjansi%5C1.11%5Cjansi-1.11.jar; org.apache.logging.log4j.core.appender.ConsoleAppenderJAnsiMessageMain log4j-core/target/test-classes/log4j2-console-style-ansi.xml%0A * %3C/pre%3E%0A * %0A */%0Apublic class ConsoleAppenderJAnsiMessageMain %7B%0A%0A    public static void main(final String%5B%5D args) %7B%0A        new ConsoleAppenderJAnsiMessageMain().test(args);%0A    %7D%0A%0A    /**%0A     * This is a @Test method to make it easy to run from a command line with %7B@code mvn -Dtest=FQCN test%7D%0A     */%0A    @Test%0A    public void test() %7B%0A        test(null);%0A    %7D%0A%0A    public void test(final String%5B%5D args) %7B%0A        // System.out.println(System.getProperty(%22java.class.path%22));%0A        final String config = args == null %7C%7C args.length == 0 ? %22target/test-classes/log4j2-console-style-ansi.xml%22%0A                : args%5B0%5D;%0A        final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), config);%0A        final Logger logger = LogManager.getLogger(ConsoleAppenderJAnsiMessageMain.class);%0A        try %7B%0A            logger.info(ansi().fg(RED).a(%22Hello%22).fg(CYAN).a(%22 World%22).reset());%0A            // JAnsi format:%0A            // logger.info(%22@%7Cred Hello%7C@ @%7Ccyan World%7C@%22);%0A        %7D finally %7B%0A            Configurator.shutdown(ctx);%0A        %7D%0A    %7D%0A%0A%7D%0A

Add example for JAnsi messages.