Package grails.build.logging
Class GrailsEclipseConsole
- java.lang.Object
-
- grails.build.logging.GrailsConsole
-
- grails.build.logging.GrailsEclipseConsole
-
- All Implemented Interfaces:
ConsoleLogger
public class GrailsEclipseConsole extends GrailsConsole
This class is meant to keep changes made in support of Eclipse separate from the standard GrailsConsole implementation.It is activated by setting system property "grails.console.class" to the fully qualified name of this class.
Having the changes in a class triggered by system property also leaves open the option to have Eclipse provide a different version of the class at runtime, to allow for further customisation to support not yet anticipated needs.
- Since:
- 2.0.0.M2
-
-
Field Summary
-
Fields inherited from class grails.build.logging.GrailsConsole
CATEGORY_SEPARATOR, ENABLE_INTERACTIVE, ENABLE_TERMINAL, ERROR, HISTORYFILE, LINE_SEPARATOR, PROMPT, SECURE_MASK_CHAR, SPACE, STACKTRACE_FILTERED_MESSAGE, STACKTRACE_MESSAGE, WARNING
-
-
Constructor Summary
Constructors Constructor Description GrailsEclipseConsole()
Create a GrailsConsole that has some customizations to work better with STS.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.io.OutputStream
ansiWrap(java.io.OutputStream out)
Hook method that allows controlling whether or not output streams should be wrapped by AnsiConsole.wrapOutputStream.protected jline.Terminal
createTerminal()
Creates the instance of Terminal used directly in GrailsConsole.-
Methods inherited from class grails.build.logging.GrailsConsole
addShutdownHook, addStatus, append, beforeShutdown, bindSystemOutAndErr, cleanlyExit, createConsoleReader, createInstance, echoStatus, error, error, error, error, flush, getCategory, getDefaultInputMask, getErr, getInput, getInstance, getLastMessage, getOut, getReader, getTerminal, indicateProgress, indicateProgress, indicateProgress, indicateProgressPercentage, info, initialize, isAnsiEnabled, isInteractiveEnabled, isStacktrace, isVerbose, isWindows, log, persistHistory, prepareHistory, redirectSystemOutAndErr, reinitialize, removeInstance, removeShutdownHook, resetCompleters, restoreOriginalSystemOutAndErr, restoreTerminal, secureUserInput, setAnsiEnabled, setDefaultInputMask, setErr, setInstance, setLastMessage, setOut, setStacktrace, setVerbose, showPrompt, updateStatus, userInput, userInput, userInput, verbose, warn, warning
-
-
-
-
Constructor Detail
-
GrailsEclipseConsole
public GrailsEclipseConsole() throws java.io.IOException
Create a GrailsConsole that has some customizations to work better with STS. Note that this console implicitly captures and redirects System.out, System.err and System.in in the super class. So extreme care must be taken to ensure these streams are setup correctly before creating an instance.- Throws:
java.io.IOException
-
-
Method Detail
-
ansiWrap
protected java.io.OutputStream ansiWrap(java.io.OutputStream out)
Description copied from class:GrailsConsole
Hook method that allows controlling whether or not output streams should be wrapped by AnsiConsole.wrapOutputStream. Unfortunately, Eclipse consoles will look to the AnsiWrap like they do not understand ansi, even if we were to implement support in Eclipse to' handle it and the wrapped stream will not pass the ansi chars on to Eclipse).- Overrides:
ansiWrap
in classGrailsConsole
-
createTerminal
protected jline.Terminal createTerminal()
Description copied from class:GrailsConsole
Creates the instance of Terminal used directly in GrailsConsole. Note that there is also another terminal instance created implicitly inside of ConsoleReader. That instance is controlled by the jline.terminal system property.- Overrides:
createTerminal
in classGrailsConsole
-
-