Class ConsoleSTDOutputHandler

java.lang.Object
java.util.logging.Handler
java.util.logging.StreamHandler
java.util.logging.ConsoleHandler
com.guicedee.logger.handlers.ConsoleSTDOutputHandler

public class ConsoleSTDOutputHandler
extends java.util.logging.ConsoleHandler
Logs to the standard output rather than the error output. Provides ansi colours if needed
Since:
13 Dec 2016
Version:
1.0
Author:
GedMarc
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object obj)
    Method equals ...
    static ConsoleSTDOutputHandler getInstance()
    Gets the instance
    java.util.logging.Level getLevel()
    Returns the level assigned to this class and not the parent
    static java.util.Map<java.lang.String,​java.util.logging.Level> getLogPackagesLevels()  
    int hashCode()
    Method hashCode ...
    boolean isColoured()
    If the output handler is working in coloured mode
    void publish​(java.util.logging.LogRecord record)  
    ConsoleSTDOutputHandler setColoured​(boolean coloured)
    Sets if the output handler must output in coloured mode
    void setLevel​(java.util.logging.Level level)
    This this level and the parent level.

    Methods inherited from class java.util.logging.ConsoleHandler

    close

    Methods inherited from class java.util.logging.StreamHandler

    flush, isLoggable, setEncoding, setOutputStream

    Methods inherited from class java.util.logging.Handler

    getEncoding, getErrorManager, getFilter, getFormatter, reportError, setErrorManager, setFilter, setFormatter

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getInstance

      public static ConsoleSTDOutputHandler getInstance()
      Gets the instance
      Returns:
      Returns the static instance for the log master
    • getLogPackagesLevels

      public static java.util.Map<java.lang.String,​java.util.logging.Level> getLogPackagesLevels()
    • publish

      public void publish​(java.util.logging.LogRecord record)
      Overrides:
      publish in class java.util.logging.ConsoleHandler
    • isColoured

      public boolean isColoured()
      If the output handler is working in coloured mode
      Returns:
      if rendering coloured
    • setColoured

      public ConsoleSTDOutputHandler setColoured​(boolean coloured)
      Sets if the output handler must output in coloured mode
      Parameters:
      coloured - If it must render coloured
      Returns:
      This handler
    • hashCode

      public int hashCode()
      Method hashCode ...
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      int
    • equals

      public boolean equals​(java.lang.Object obj)
      Method equals ...
      Overrides:
      equals in class java.lang.Object
      Parameters:
      obj - of type Object
      Returns:
      boolean
    • getLevel

      public java.util.logging.Level getLevel()
      Returns the level assigned to this class and not the parent
      Overrides:
      getLevel in class java.util.logging.Handler
      Returns:
      the JDK 8 Level object
    • setLevel

      public void setLevel​(java.util.logging.Level level)
      This this level and the parent level.
      Overrides:
      setLevel in class java.util.logging.Handler
      Parameters:
      level - The level to apply