Colorize logs in eclipse console

后端 未结 10 681
别那么骄傲
别那么骄傲 2020-12-07 08:45

Is there a way to colorize parts of logs in the eclipse console. I know I could send to error and standard streams and color them differently but I\'m more looking someting

相关标签:
10条回答
  • 2020-12-07 09:33

    I've used this plugin before, it lets you colourize lines of the log based on customized regex.

    For example, when I was using it, any lines with the words error would be red, warning would be orange, info would be blue... etc.

    Since it's regex, you could do anything. Set it up to make the line green whenever it starts with ">>>" and then prepend your message string with ">>>".

    http://sourceforge.net/projects/logfiletools

    0 讨论(0)
  • 2020-12-07 09:35

    Actually the ANSI Console plugin adds ANSI escape code support to Eclipse console. At present it does have a limitation though, whereby escape codes that span multiple lines leak incorrectly to other lines when scrolling, see issue #3.

    Otherwise some terminal view plugin as explained in this other question might be an option for some.

    0 讨论(0)
  • 2020-12-07 09:43

    Have a try with this Eclipse Plugin: Grep Console

    [Update]:
    As pointed out by commenters: When installing Grep Console in the currently last version of Eclipse, you need to uncheck 'Group items by category' in the Install dialog to see the available items.
    As pointed out by @Line the plugin can now be easily installed via the Eclipse Marketplace again without changing any options.

    [Update 2]:
    As pointed out by @azdev, to get proper highlighting:

    Entering just literal strings doesn't work. To get a line to be colored, you have to enclose the string in .* on either side, like so: .*ERROR.*

    0 讨论(0)
  • 2020-12-07 09:46

    What about use Logback and its property converter and log everything in log4j, that may allow you see the differents levels on differents colors.

    Good luck!

    EDIT: the eclipse plugin

    0 讨论(0)
提交回复
热议问题