Grails console enhancements
Dependency :
compile ":console-enhancements:1.0"Custom repositories :
mavenRepo "http://snapshots.repository.codehaus.org/" mavenRepo "http://repository.codehaus.org/"
Summary
Enhances the grails console output for better visibility
Installation
grails install-plugin console-enhancements
Description
Enhances the grails console output for better visibility.
Features
UsageUsage is designed to be as simple and as unintrusive as possible. Essentially this plugin takes the bold step of overriding the 'println' method on the Object class'. What this means is that any time you type:Your println will come up in the console in bold, colour, flashing, or whatever custom values you have put into the configuration (see below)If you want to use a custom set of colours for a particular println, you can use up to three:If you want any more control, see 'advanced usage below'.ConfigurationConfiguration is automatic, if you like your printlns in bold aqua coloured text. If not, it's simple to override:Where the list assigned to the 'normal' attribute can by any number of values from the provided
- System.out.println colouring.
- Colours printlns separately from other console output for better visibility.
- Console test-runner output colouring and enhanced display.
- Test case name is printed to console
- A failing test will show up in red.
- A passing test will show up in green.
- A failing test will turn all further tests red in case it scrolls off the screen.
println ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ${myValue}"println "my text"println ANSICode.ITALIC_ON, ANSICode.FOREGROUND_RED, ANSICode.BACKGROUND_YELLOW, "my text"console {
colours {
normal = [ANSICode.FOREGROUND_RED, ANSICode.BOLD_ON]
}
}ANSICode enum. The ANSI escape sequence is automatically reset after each println.LimitationsThis plugin requires that you have an ANSI capable terminal. As with most things that are great about computing, this means that this plugin will not work on windows, and will likely print a number of ugly ANSI escape sequences around your printlns!Advanced UsageYou can format any text using ANSI by manually invoking the ANSISequence class' .format method. This is probably most useful in Grails event scripts:new ANSISequence(ANSICode.FOREGROUND_YELLOW, ANSICode.BACKGROUND_MAGENTA).format('test message')