Grep Console (Eclipse Plug-in)

Developers usually have their programs write log and debug information to the standard output during coding and testing. This results in a lot of text being printed to Eclipse’s console view, often more than can be easily surveyed. Since at any given time, only a small part of this information is of primary interest to the developer, a tool which highlights specific lines or words can significantly increase the readability of this output.

Grep Console allows you to define a series of regular expressions which will be tested against the console output. Each expression matching a line will affect the style of either the entire line or parts of it. For example, error messages could be set to show up with a red background, or integer values showing the state of a certain variable could be rendered in bold font. Grep Console can also filter console output by only showing lines that match certain expressions.

Review Grep Console at the Eclipse Marketplace. Become a follower at Facebook or Google+.

Version 3.4 of Grep Console was released on 2013-03-28.

You can read the user guide here.

01547290113bd17433deedeac86fd51c
Share via email

22 Responses to Grep Console (Eclipse Plug-in)

  1. Channing says:

    It would be nice if there was an option to not print the line at all if it matches a pattern. Right now I am setting the foreground and background to white, but it still causes the messages I’m interested in to scroll by quickly.

    • I agree. In fact, this was the original idea, but I failed to get this working with the Eclipse components. I have an update in the works (nearly finished) that will do something similar though. To be released soon, hopefully.

  2. lindbert says:

    Anyway, nice plugin, can’t live without it!

  3. michaelz8n says:

    Maybe this plugin (that I haven’t tested yet) could help (to filter lines you don’t want to read in the console) : http://code.google.com/a/eclipselabs.org/p/console-grep/

    • Thanks. That sounds pretty much like what I’m doing in the new version that’s in the new version. Except that I’m showing the results in a separate view… might be worth thinking about moving that to a custom console later on.

  4. Roger says:

    Nice plugin thanks a lot for your work. Is there a easy way to export all my expressions and to deploy it to my colleges?

    Regards, Roger

    • Two options. The upcoming version 3.0 I’ve been promising above (it’s really very close to being done now) will have options to copy & paste expressions and to export them to XML files and import them on another system.

      In the meantime, you can manually copy the settings of Grep Console between different workspaces. You’ll find the settings file in your Eclipse workspace in this sub path:

      .metadata/.plugins/org.eclipse.core.runtime/.settings/com.musgit.eclipse.grepconsole.prefs

      Just copy that to another workspace and (re)start Eclipse and you should have the same settings there. To just transfer some settings, open the file in a text editor (it’s in XML format) and copy the bits you want.

  5. Pingback: Zwei Eclipse Plugins für Juno installiert, Grep Konsole und Web | Wenzlaff.de: Rund um die Programmierung

  6. Cool, works fine.
    Thanks for nice tool :-)

    CU
    Thomas
    wenzlaff.de

  7. Pingback: Eclipse Juno – Les meilleurs plugins pour le web | Netsyos

  8. Bruno Silva says:

    Cool plugin! Really, really useful. Any way of matching an expression over several lines? For instance,

    some
    text that I want in blue

    could be regexp’d with

    .*(.*).*

    and then I would color group 1 with blue. Is this possible?

    Thanks!

    • Bruno Silva says:

      ugh, the thing ate all the tags I wrote. Anyway, it would be something like

      [blue] some text
      that I want colored
      [\blue]

      and that would be regexp’d with

      .*[blue](.*)[\blue].*

      • This would be a cool feature, and I have thought about it before. Sadly, I don’t think it’s feasible the way Grep Console is implemented at the moment. Line highlighting works through a standard SWT listener, which operates on a line by line basis. To handle ranges of multiple lines, I’d have to do handle each line manually. This would likely be a performance issue as well, as SWT only calls the line listener when a line is displayed (so when console output runs so fast that you can barely follow it, only some of the lines are actually passed to the listener), but I’m not sure if I could easily reproduce that with my own code.
        Of course, if anyone else wants to implement this, I’d be happy to accept code contributions.

  9. Lukasz says:

    Thanks for this great plugin! Here’s an idea: We could tweak it for team purpose, i.e. regexps are stored on the remote repository and shared among the team members.

    Could you post a link to the sources?

  10. Tom says:

    I cant seem to find any way to make the grep case insensitive. Have I missed something or can I ask this be added as a feature.

    • I had to look this one up in the Java API docs myself. You can use “(?i)” (sans the quotes) in your expression to deactivate case sensitivity for ASCII characters. To also make unicode characters case insensitive, you must add “(?u)”.

      Perhaps I’ll include a checkbox in the next version to make this more comfortable.

  11. nut says:

    Thanks for these cool plugin/work!! :-)
    But wondering, using Eclipse 4.2 (Juno) I’m missing the ability to open a “Grep View”. Is it right, that normally there is a entry in the pull-down Menue for “OpenConsole”?

  12. Does this work with juno?

  13. Serhii Belei says:

    I’d like to have “play sound” feature in eclipse with this plugin. Is it possible? (I can help to implement it)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>