Alexandre Dutra created LOGBACK-1392:
----------------------------------------
Summary: Improve support for the JANSI library in ConsoleAppender
Key: LOGBACK-1392
URL: https://jira.qos.ch/browse/LOGBACK-1392
Project: logback
Issue Type: Improvement
Components: logback-core
Affects Versions: 1.2.3
Reporter: Alexandre Dutra
Assignee: Logback dev list
Priority: Minor
The JANSI library provides an {{AnsiPrintStream}} that intercepts ANSI
sequences and allows the application to react to them accordingly. Jansi is
compatible with a variety of terminals, including xterm-like terminals for
Windows like Mintty and MinGW.
Jansi has a good algorithm to detect whether or not ANSI sequences will be
correctly interpreted or not, and if not, its default behavior is to filter out
such sequences.
Logback's {{ConsoleAppender}} has a {{withJansi}} option. Unfortunately,
Logback bypasses Jansi's detection algorithm and boldly assumes that if the OS
is Windows, then the terminal is a DOS prompt. So while DOS prompts get
colored, terminals like Mintty or MinGW not only lose their coloring but are
sent DOS escape sequences that they can't interpret.
We could improve support for JANSI with the following ideas:
* Amend {{ConsoleAppender}} so that when {{withJansi}} is {{true}}, then all
{{OutputStream}}s are wrapped in an {{AnsiPrintStream}}, effectively delegating
to the JANSI library the decision to filter out ANSI escape sequences or not,
depending on the terminal capability. This also allows users to disable or
customize the coloring behavior by using system properties recognized by JANSI,
such as {{jansi.skip}}.
* Amend the documentation and stress that the JANSI library is the recommended
solution for Windows systems, as well as for cross-platform deployments that
include a mix of Windows and non-Windows systems.
--
This message was sent by Atlassian JIRA
(v7.3.1#73012)
_______________________________________________
logback-dev mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/logback-dev