mihnita / ansi-econsole

Eclipse plugin that understands ANSI escape sequences to color the Eclipse console output.
http://www.mihai-nita.net/java/
Other
91 stars 25 forks source link

Stack Trace coloring no longer working #40

Closed XtinctElise closed 4 years ago

XtinctElise commented 5 years ago

When the ANSI Escape in Console is enabled, the stack trace output blue coloring and underline that denotes a hyperlink quits working. You can still click on the hyperlink but it appears as standard black text and new users do not realize it is clickable.

How can we still display the underlined blue hyperlinks for the stack trace with ANSI Escape in Console enabled?

mihnita commented 5 years ago

Thank you, I will take a look.

famod commented 5 years ago

Same here, Eclipse 2019-09.

PyvesB commented 4 years ago

Not sure whether this is directly related, but when running Maven builds (for instance this library), I'm seeing a lot of incorrect blue line colouring in the output:

Screenshot 2020-01-17 at 13 33 48

kdvolder commented 4 years ago

Similar effects observed as @PyvesB reports. I will add that not only are the black and blue colors being displayed incorrectly, the colors are actually 'unstable'. Every time a error message is printed that should normally get the hyperlink/underline, the black and blue colors are changing in a somewhat unpredictable way (some stuff that was black becomes blue and vice versa).

I was able to reproduce this by running some code that deliberately logs stuff that 'looks like' an error message. Here's my test code (it's the main method of a very simple maven/spring-boot app).

package com.example.demo;
import java.util.Random;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
@SpringBootApplication
@EnableScheduling
public class VmargDumperApplication {
    Random rnd = new Random();
    private static final Logger log = LoggerFactory.getLogger(VmargDumperApplication.class);
    public static void main(String[] args) {
        SpringApplication.run(VmargDumperApplication.class, args);
    }
    @Scheduled(fixedRate = 200)
    public void doStuff() {
        int x = rnd.nextInt(8);
        if (x==0) {
            log.error("java.lang.IllegalArgumentException: test");
        }
        log.info("Stuff = "+x);
    }
}

Full zip of the test project: vmarg-dumper.zip

Import this as a 'Existing Maven Project' or 'Existing Project'. Then run the main class with ansi console enabled.

You will see that every time the message java.lang.IllegalArgumentException: test is printed the black and blue colors on the screen are jumping around (other colors seem to remain correct).

More info: Observed this during testing of (about to be released) STS 4.5.1 which is based on Eclipse 4.14.

mihnita commented 4 years ago

Fixed by version 1.4.0.202001252332

PyvesB commented 4 years ago

I've updated to the latest version, looks great so far, thanks @mihnita !