Class JansiConsoleAppender<E>

Type Parameters:
E - the type of logging events
All Implemented Interfaces:
Appender<E>, ContextAware, FilterAttachable<E>, LifeCycle

public class JansiConsoleAppender<E> extends ConsoleAppender<E>
A ConsoleAppender that always writes through JLine's AnsiConsole, enabling ANSI sequences on platforms that need Jansi (notably Windows).

Unlike ConsoleAppender's deprecated withJansi path, this class overrides wrapTarget(OutputStream) and calls AnsiConsole directly (no reflection). It requires org.jline:jansi-core on the classpath.

AnsiConsole.systemInstall() is paired with AnsiConsole.systemUninstall() on stop() when this appender performed the install. Console streams are still only flushed on stop (not closed); see ConsoleAppender.closeOutputStream().

Since:
1.6.3
Author:
Ceki Gülcü
See Also: