-
Notifications
You must be signed in to change notification settings - Fork 3
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
How to configure ansi color output #55
Comments
Okay it seems like when compiling and using the jar as is, it works. Just in the IntelliJ terminal no colored output is provided, any idea here? |
JAnsi detects that it is not compatible. In the long run because of the draft security JEP we may drop JAnsi. An easy fix that I can put in is to detect intellij via system properties or similar and turn of JAnsi. |
Anyway I'm rolling out a new release very soon of 0.3.0. Hopefully the builder API didn't change too much that it breaks for you. Once I hit 0.5.0 sometime this month the API will be more stable and by July hopefully 1.0.0 |
Also see this bug: fusesource/jansi#31 The easiest solution for now is to detect a system property that intellij hopefully sets. We already do this for surefire because it has issues as well: private boolean installJansi(LogConfig config) {
if (!System.getProperty("surefire.real.class.path", "").isEmpty()) {
return false;
}
var disableProperty = Boolean.parseBoolean(config.properties().valueOrNull(JANSI_DISABLE));
if (disableProperty) {
return true;
}
return true;
} However it may not set any properties when it forks the processes and or they are not official so it would be kind of a hack. |
@cmdjulian I can't load up intellij at the moment (yes I'm using Eclipse right now for null analysis but I do use Intellij from time to time). In your application at boot up can you dump It may not set any but I'm hoping it might. |
Oh, that's unfortunate 😞
Cool, thanks for proving the lib! 😄 I integrated it into one of my OSS projects whats-the-los which is using GraalVM with native-image. Not a real benchmark, but I noticed using you lib in favor of using
I checked but unfortunately there is no special property nor a certain env variable differentiating my default gnome terminal and the intellij one 😞 PS: one small suggestion though, you may have noticed that I did include not just |
I think unless I misunderstood that it is by design.
This is in the doc: https://jstach.io/rainbowgum/#installation See the text:
The idea is basically if you are using builders to create a custom rainbow gum you are a developer that knows how to manage deps but I agree the doc and or ergonomics could be better. Because what you really want to do is (and I'm going to use mavens of scopes as gradle can do all of it and more): mygroupId:my-rainbowgum-config.jar: <dependencies>
<dependency>
<groupId>io.jstach.rainbowgum</groupId>
<artifactId>rainbowgum-core</artifactId>
<version>${rainbowgum.version}</version>
<scope>compile</scope>
<optional>true</optional> <!-- this is optional pun intended -->
</dependency>
</dependencies> Then in your application you do: <dependencies>
<dependency>
<groupId>io.jstach.rainbowgum</groupId>
<artifactId>rainbowgum</artifactId>
<version>${rainbowgum.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>mygroupId</groupId>
<artifactId>my-rainbowgum-config</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies> The above is the modular way to do it but some folks probably would prefer everything in one application and thus why I wrote the doc as EDIT I see what your saying. You are saying if you do:
All the others should be |
I have the following logger:
This is my gradle config:
As you can see in my pattern I have configured colored output. Regardless of that the output is just white. Is there something I do wrong?
The text was updated successfully, but these errors were encountered: