-
Notifications
You must be signed in to change notification settings - Fork 25
Support for Ansi colors in console logger #177
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
Conversation
} else { | ||
// check logging properties to see if the user wants to disable color output | ||
String flag = LogManager.getLogManager().getProperty("java.util.logging.ConsoleHandler.color"); | ||
if (flag != null && flag.equalsIgnoreCase("false")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just put the property on your ConsoleFormatter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no reason, other than to simplify the interface for the user. The user only knows about the ConsoleHandler (within the logging.properties file), and the formatter is injected into all ConsoleHandlers. The Handler seemed like the right place for the setting.
} | ||
|
||
private String replaceColorTokens(String text) { | ||
//Pattern pattern = Pattern.compile("\\[([a-z]+)\\]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented line.
Why not put this up in the class variables so it is only done once?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
imagetool/src/main/java/com/oracle/weblogic/imagetool/logging/ConsoleFormatter.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest changes work with Windows.
Adding color to the console logger makes it easier to see key data in the user's console.