Grep Console - User Guide

Version 2.0

Warning: This is an old version of Grep Console. You can find the current version here.

Screenshot

Contents

  1. Introduction
  2. Requirements
  3. Installation
  4. Actions
  5. Managing Grep Expressions
  6. Editing Grep Expressions
  7. License

Introduction

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.

Requirements

Grep Console requires Eclipse 3.4 (Ganymede) or higher.

Installation

To install Grep Console from the Update Site, select Help/Software Updates/Available Software from your Eclipse menu and click Add Site to add the following URL:

http://eclipse.musgit.com

You can now open the site in the list of available software, check Grep Console and click Install to begin the installation process.

Actions

Grep Console contributes two actions to the menu of Eclipse's console views. These actions carry the Grep Console icon: Icon

Add Grep Expression
Prepares a grep expression from the currently selected text and opens it in the Edit dialog.
Manage Grep Expressions
Opens the dialog for managing grep expressions. This action is also available in the console's toolbar.

Managing Grep Expressions

This dialog allows you to add, edit and delete grep expressions. The list on the left displays all currently available expressions, by name if available, or otherwise by their expression string. For each expression, the primary foreground and background colour are shown. A checkbox to the left of each grep expressions can be used to enable or disable individual entries without deleting them. No changes are commited until Ok or Apply is pressed.

Screenshot
The Manage Grep Expressions Dialog

Available actions are:

Add
Opens the Edit dialog for a new grep expression. The new expression will be added to the beginning of the list.
Copy
Opens the Edit dialog for a copy of the currently selected grep expression. The new expression will be added to the beginning of the list.
Edit
Opens the Edit dialog for editing the currently selected grep expression.
Remove
Deletes the currently selected grep expressions(s).
Up/Down
Moves the currently selected grep expression(s) up or down. Items at the top of the list have precedence over later items when determining the style of console output.

Editing Grep Expressions

This dialog is used to edit a single grep expression (or create a new one).

Screenshot
The Edit Grep Expression Dialog

The name of an expression is only used to display the list of available items in the management dialogue and is completely optional. The expression is mandatory and defines the grep expression string used by this item. All expressions supported by Java's Pattern class are allowed; see the official Java API Documentation by Sun for details.

A list on the left side of the dialog shows all the available capturing groups defined by the grep expression. Capturing groups are parts of the expression surrounded by parantheses, like the literal string ERROR in the image above. Each of these groups can be styled individually; the first item in the list is always available and represents the entire line matched by the expression.

Next to this list, the style for the selected group can be edited. Each item in the style can be enabled or disabled by a checkbox. Colours can be entered manually as a 6-digit hexadecimal code or selected in a colour dialog by clicking the button next to the corresponding text field.

When determining the styles of a line of text in a console view, all available grep expressions will be tested in the order in which they are listed in the management dialog. Each expression will be tested against the line, and those that match will contribute to the line's style. For each section of a line, the style attributes will be applied in the order in which the expressions were defined. An expression can only affect a style attribute that was not already set by a previous expression. For example, if two expressions specify different foreground colours for different parts of the same line, both will be applied, but if both expressions would refer to the same part of the same line, only the first one would have an effect.

License

Grep Console is licensed under the terms of the Eclipse Public License v1.0.
Copyright © 2008 Marian Schedenig.