org.springframework.shell.core
Class JLineLogHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by org.springframework.shell.core.JLineLogHandler

public class JLineLogHandler
extends Handler

JDK logging Handler that emits log messages to a JLine ConsoleReader.

Since:
1.0

Constructor Summary
JLineLogHandler(jline.ConsoleReader reader, ShellPromptAccessor shellPromptAccessor)
           
 
Method Summary
static void cancelRedrawProhibition()
           
 void close()
           
 void flush()
           
static jline.ANSIBuffer getANSIBuffer()
          Makes text brighter if requested through system property 'roo.bright' and works around issue on Windows in using reverse() in combination with the Jansi lib, which leaves its 'negative' flag set unless reset explicitly.
static boolean isSuppressDuplicateMessages()
           
static void prohibitRedraw()
           
 void publish(LogRecord record)
           
static void resetMessageTracking()
           
static void setIncludeThreadName(boolean include)
           
static void setSuppressDuplicateMessages(boolean suppressDuplicateMessages)
           
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JLineLogHandler

public JLineLogHandler(jline.ConsoleReader reader,
                       ShellPromptAccessor shellPromptAccessor)
Method Detail

flush

public void flush()
Specified by:
flush in class Handler

close

public void close()
           throws SecurityException
Specified by:
close in class Handler
Throws:
SecurityException

prohibitRedraw

public static void prohibitRedraw()

cancelRedrawProhibition

public static void cancelRedrawProhibition()

setIncludeThreadName

public static void setIncludeThreadName(boolean include)

resetMessageTracking

public static void resetMessageTracking()

isSuppressDuplicateMessages

public static boolean isSuppressDuplicateMessages()

setSuppressDuplicateMessages

public static void setSuppressDuplicateMessages(boolean suppressDuplicateMessages)

publish

public void publish(LogRecord record)
Specified by:
publish in class Handler

getANSIBuffer

public static jline.ANSIBuffer getANSIBuffer()
Makes text brighter if requested through system property 'roo.bright' and works around issue on Windows in using reverse() in combination with the Jansi lib, which leaves its 'negative' flag set unless reset explicitly.

Returns:
new patched ANSIBuffer