Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WindowsAnsiOutputSteam warnings in log4j2 #134

Closed
calvertdw opened this issue Dec 14, 2018 · 1 comment
Closed

WindowsAnsiOutputSteam warnings in log4j2 #134

calvertdw opened this issue Dec 14, 2018 · 1 comment

Comments

@calvertdw
Copy link

When using jansi I get multiple of the following warning messages in the console:

2018-12-14 11:31:45,437 main WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream due to java.io.IOException: Could not get the screen info: T h e   h a n d l e   i s   i n v a l i d .

May I suggest adding the following code to WindowsAnsiOutputStream to at least format the warning better:

if (GetConsoleScreenBufferInfo(console, info) == 0) {
    String lastErrorMessage = WindowsSupport.getLastErrorMessage().trim().replaceAll("\0", "");
    throw new IOException("Could not get the screen info: " + lastErrorMessage);
}
gnodet added a commit that referenced this issue Apr 3, 2019
@gnodet gnodet closed this as completed Apr 3, 2019
@calvertdw
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants