Class ConsoleLogHandler


  • public class ConsoleLogHandler
    extends java.util.logging.Handler
    Implementation of Java Logging API handler.
    • Constructor Summary

      Constructors 
      Constructor Description
      ConsoleLogHandler()
      Default constructor.
      ConsoleLogHandler​(java.util.logging.Formatter formatter)
      Construct handler with using giver formatter.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      static void defaultConsoleLogging​(java.util.logging.Level logLevel)
      Setup this handler as the only one root handler.
      void flush()  
      void publish​(java.util.logging.LogRecord record)
      Prints the log record to the console using the current formatter, if the log record is loggable.
      • 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

      • ConsoleLogHandler

        public ConsoleLogHandler()
        Default constructor.
      • ConsoleLogHandler

        public ConsoleLogHandler​(java.util.logging.Formatter formatter)
        Construct handler with using giver formatter.
        Parameters:
        formatter - console log formatter, non-null.
    • Method Detail

      • close

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

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

        public void publish​(java.util.logging.LogRecord record)
        Prints the log record to the console using the current formatter, if the log record is loggable.
        Specified by:
        publish in class java.util.logging.Handler
        Parameters:
        record - the log record to publish
        See Also:
        Handler.publish(java.util.logging.LogRecord)
      • defaultConsoleLogging

        public static void defaultConsoleLogging​(java.util.logging.Level logLevel)
        Setup this handler as the only one root handler.
        Parameters:
        logLevel - root log level to be set.