Package com.guicedee.logger.handlers
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 booleanequals(java.lang.Object obj)Method equals ...static ConsoleSTDOutputHandlergetInstance()Gets the instancejava.util.logging.LevelgetLevel()Returns the level assigned to this class and not the parentstatic java.util.Map<java.lang.String,java.util.logging.Level>getLogPackagesLevels()inthashCode()Method hashCode ...booleanisColoured()If the output handler is working in coloured modevoidpublish(java.util.logging.LogRecord record)ConsoleSTDOutputHandlersetColoured(boolean coloured)Sets if the output handler must output in coloured modevoidsetLevel(java.util.logging.Level level)This this level and the parent level.Methods inherited from class java.util.logging.ConsoleHandler
closeMethods inherited from class java.util.logging.StreamHandler
flush, isLoggable, setEncoding, setOutputStreamMethods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, reportError, setErrorManager, setFilter, setFormatterMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
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:
publishin classjava.util.logging.ConsoleHandler
-
isColoured
public boolean isColoured()If the output handler is working in coloured mode- Returns:
- if rendering coloured
-
setColoured
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:
hashCodein classjava.lang.Object- Returns:
- int
-
equals
public boolean equals(java.lang.Object obj)Method equals ...- Overrides:
equalsin classjava.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:
getLevelin classjava.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:
setLevelin classjava.util.logging.Handler- Parameters:
level- The level to apply
-