Package wsh.util
Class CleanHandler
- java.lang.Object
 - 
- java.util.logging.Handler
 - 
- wsh.util.CleanHandler
 
 
 
- 
public class CleanHandler extends java.util.logging.HandlerAn alternative to ConsoleHandler. Uses CleanFormatter and System.out instead of SimpleFormatter and System.err 
- 
- 
Constructor Summary
Constructors Constructor Description CleanHandler()Construct a new CleanHandler. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddGlobalLogFile(java.lang.String fileName)All CleanHandlers will also log to this file.voidclose()voidflush()static voidmain(java.lang.String[] args)Test codestatic voidoverrideExistingHandlers(java.util.logging.Level level)Override any previously specified Handlers with the CleanHandler, and set Level.voidpublish(java.util.logging.LogRecord record)static voidsetDefaultHandler()If the user has not specified a java property for the global Handler, then set the default global handler to this CleanHandler at an INFO level.static voidtestLogger()Call this from your code to test each type of log message 
 - 
 
- 
- 
Method Detail
- 
addGlobalLogFile
public static void addGlobalLogFile(java.lang.String fileName) throws java.io.FileNotFoundExceptionAll CleanHandlers will also log to this file.- Parameters:
 fileName- Name of file to log to.- Throws:
 java.io.FileNotFoundException- if file not found
 
- 
publish
public void publish(java.util.logging.LogRecord record)
- Specified by:
 publishin classjava.util.logging.Handler
 
- 
close
public void close()
- Specified by:
 closein classjava.util.logging.Handler
 
- 
flush
public void flush()
- Specified by:
 flushin classjava.util.logging.Handler
 
- 
testLogger
public static void testLogger()
Call this from your code to test each type of log message 
- 
main
public static void main(java.lang.String[] args)
Test code- Parameters:
 args- command line
 
- 
setDefaultHandler
public static void setDefaultHandler()
If the user has not specified a java property for the global Handler, then set the default global handler to this CleanHandler at an INFO level. 
- 
overrideExistingHandlers
public static void overrideExistingHandlers(java.util.logging.Level level)
Override any previously specified Handlers with the CleanHandler, and set Level.- Parameters:
 level- Logging level for CleanHandler.
 
 - 
 
 -