Class AbstractJavaLogger.ConsoleHandler

  • Enclosing class:
    AbstractJavaLogger

    protected class AbstractJavaLogger.ConsoleHandler
    extends java.util.logging.Handler
    Console Handler for the JavaLogger to allow the specification of the desired system console.
    This logger will log per default to System.err.
    Author:
    El-Sharkawy
    See Also:
    setConsole(PrintStream)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.PrintStream console  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ConsoleHandler()
      Constructs a new ConsoleHandler.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void flush()  
      void publish​(java.util.logging.LogRecord record)  
      void setConsole​(java.io.PrintStream console)
      Sets the output console of this console logger.
      • 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
    • Field Detail

      • console

        private java.io.PrintStream console
    • Constructor Detail

      • ConsoleHandler

        protected ConsoleHandler()
        Constructs a new ConsoleHandler.
    • Method Detail

      • publish

        public void publish​(java.util.logging.LogRecord record)
        Specified by:
        publish in class java.util.logging.Handler
      • flush

        public void flush()
        Specified by:
        flush in class java.util.logging.Handler
      • close

        public void close()
                   throws java.lang.SecurityException
        Specified by:
        close in class java.util.logging.Handler
        Throws:
        java.lang.SecurityException
      • setConsole

        public void setConsole​(java.io.PrintStream console)
        Sets the output console of this console logger.
        Parameters:
        console - Must be System.out or System.err.